home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / Tele / Pete Johnson / Archie 1.62⁄F<source> Folder / Archie 1.62⁄F.BAS < prev    next >
Encoding:
BASIC Source File  |  1990-03-02  |  85.0 KB  |  3,427 lines  |  [TEXT/ZBAS]

  1. '   - Archive Utility for Red Ryder Host
  2. '      - Written by Pete Johnson
  3. '        - Glassell Park BBS (213) 258-7649
  4. '          - GEnie address PETERJ
  5. '
  6. '    - Thanks to John Alcock, Robert Lanza, Ed Edell, Patricia O'Connor,
  7. '      - Jon Haferman, Ray Terry, Otis Eversole, Greg Hulbert,
  8. '        - Dennis Cosio and Ralph Yount for their help and comments.
  9. '
  10. '    - Compiled in ZBasic version 5.0. To recompile,
  11. '      - turn on "Space required after key words" option
  12. '        - with the ZBasic Configure menu.
  13. '
  14. WINDOW OFF
  15. DIALOG OFF
  16. MOUSE OFF
  17. BREAK OFF
  18. MENU OFF
  19. TIMER OFF
  20. WIDTH -2
  21. FALSE = 0
  22. TRUE = NOT FALSE
  23. Registered = TRUE
  24. DEF LEN = 8
  25. Version$ = "1.62/"
  26. IF Registered THEN Version$ = Version$ + "F" ELSE Version$ = Version$ + "L"
  27. DEF LEN = 20
  28. When$ = "March 2, 1990"
  29. DEF LEN = 2
  30. CR$ = CHR$(13)
  31. EOL$ = CR$
  32. LF$ = CHR$(10)
  33. DEF LEN = 254
  34. APPLE MENU "About Archie ’89"
  35. MENU 1, 0, 1, "File"
  36. MENU 1, 1, 1, "/RReturn to Host"
  37. MENU 1, 2, 1, "/TTransfer…"
  38. MENU 1, 3, 0, ";"
  39. MENU 1, 4, 1, "Hang up without update"
  40. MENU 1, 5, 1, "/QQuit to Desktop"
  41. EDIT MENU 2
  42. MENU 3, 0, 1, "Sysop"
  43. MENU 3, 1, 1, "Break in for Chat"
  44. Temp$ = "Archie ’89 "+Version$+" by Pete Johnson"
  45. MENU 4, 0, 0, Temp$
  46. Temp$ = "From the late lamented Glassell Park BBS"
  47. MENU 4, 1, 0, Temp$
  48. Temp$ = "Written in ZBasic for Host 2.0 and beyond…"
  49. MENU 4, 2, 0, Temp$
  50. Volume$ = ""
  51. DEF LEN = 80
  52. WINDOW 1, "", (10, 30)-(502, 330), 2
  53. WINDOW 2, "", (7,  27)-(505, 50),  3
  54. WINDOW 3, "", (7,  50)-(505, 333), 3
  55. DEFSTR LONG
  56. DEF FN MakeStr$(Temp$) = MID$(Temp$, 2, ASC(LEFT$(Temp$,1)))
  57. DEF FN EncodeStr$(Temp$) = CHR$(LEN(Temp$)) + Temp$
  58. DEF FN MakeTime = (60 * VAL(MID$(Temp$, 4, 2))) + VAL(RIGHT$(Temp$, 2))
  59. DEF FN Short = (256 * ASC(MID$(Temp$, 1, 1))) + ASC(MID$(Temp$, 2, 1))
  60. DEF FN MakeShort$(Temp) = CHR$(Temp / 256) + CHR$(Temp MOD 256)
  61. '      Following function from August 1987 MacTutor article by Dave Kelly
  62. LONG FN ReturnString$(SHndl&)
  63. LengthByte% = PEEK(PEEK LONG(SHndl&))
  64. Resource$ = ""
  65. FOR Count% = 1 TO LengthByte%
  66. Resource$ = Resource$ + CHR$(PEEK(PEEK LONG(SHndl&) + Count%))
  67. NEXT Count%
  68. END FN = Resource$
  69. '
  70. '    Following are long variables
  71. '    Following variables are for menus -- allowing 75 lines per menu
  72. DEF LEN = 62
  73. DIM CmdType(75), TitleText$ (3), MenuText$(75)
  74. DEF LEN = 2
  75. DIM CmdKey$(75)
  76. DEF LEN = 42
  77. DIM CmdOpt$(75)
  78. '    And some non-string menu items...
  79. DIM CmdMod(75), CmdClr(75), Restrict&(75), CmdRMod(75)
  80. '    Next variable is for volume IDs for the directory routine
  81. DEF LEN = 120
  82. DIM Volume$(200)
  83. DIM UserLogLine$(4)
  84. DIM Upload$(26)
  85. '       Next variables are for Archie defaults
  86. DEF LEN = 60
  87. DIM Archie$(9)
  88. DIM ResName$(9)
  89. '       FOR ... NEXT loop loads resource names from DATA statements
  90. FOR Resource% = 130 TO 138
  91. READ ResName$(Resource%)
  92. NEXT Resource%
  93. '    Long default string length to avoid problems.
  94. DEF LEN = 160
  95. '    Text$() for log search command.
  96. DIM Text$(21)
  97. '    Create QEDit-compatible textfiles
  98. DEF OPEN = "TEXTQED1"
  99. '      Next two values check Carrier Detect on a Mac Plus (& others?)
  100. Modem = VAL("&H2CE")
  101. Hang = VAL("&H20")
  102. Device = 0
  103. NoShow = FALSE
  104. Local = FALSE
  105. Password = FALSE
  106. UserEdit = FALSE
  107. UserDelete = FALSE
  108. UploadFlag = FALSE
  109. ChatFlag = FALSE
  110. DEF LEN = 52
  111. NextQuitCont$ = "N>ext, Q>uit, C>ontinuous, RETURN = Next (N,Q,C)? "
  112. DEF LEN = 34
  113. Proceed$ = "     <C to interrupt, S to pause>"
  114. DEF LEN = 28
  115. Continue$ = "Hit any key to continue... "
  116. DEF LEN = 20
  117. StandBy$ = "Please stand by..."
  118. DEF LEN = 26
  119. BeginFile$ = "<<< Beginning of file >>>"
  120. Continue1$ = "Hit any key to continue "
  121. DEF LEN = 24
  122. Exit$ = "Hit any key to exit... "
  123. DEF LEN = 20
  124. Dash$ = "--------------------"
  125. EndFile$ = "<<< End of file >>>"
  126. DEF LEN = 16
  127. Return$ = "<Return to quit>"
  128. Now$ = DATE$
  129. Now& = 365 * VAL(MID$(Now$, 7, 2)) + 30.5 * VAL(MID$(Now$, 1, 2)) + VAL(MID$(Now$, 4, 2))
  130. DEF LEN = 12
  131. Indent$ = "         "
  132. LaunchFile$ = "LaunchRRH"
  133. DEF LEN = 76
  134. DIM FSec$(10)
  135. DIM Caller$(9)
  136. DEF LEN = 160
  137. '
  138. '    ------------- Main Program -------------
  139. '
  140. GOSUB "Get Archie Info"
  141. GOSUB "Host Status"
  142. ON ERROR GOSUB "Exit"
  143. ON MENU GOSUB "Menu Event"
  144. GOSUB "User Status"
  145. GOSUB "Refresh Window"
  146. IF Local THEN Device = 0 ELSE Device = Port
  147. IF NOT Local THEN OPEN "C", Port, Baud, 0, 0, 1, 8192
  148. IF LineFeed THEN EOL$ = CR$ + LF$
  149. MenuFile$ = ArchieMenu$
  150. "Main Loop"
  151. Interrupt = FALSE
  152. GOSUB "Echo LF"
  153. GOSUB "Read A Menu"
  154. SELECT Command
  155. CASE   2:MenuFile$ = Option$
  156. CASE  12:GOSUB "Text Display": REM Display text, Ctl-C cancel, paged
  157. CASE  13:GOSUB "Text Display": REM Display text, no cancel, paged
  158. CASE  14:GOSUB "Text Display": REM Display text, Ctl-C cancel
  159. CASE  87:IF Registered THEN GOSUB "File Search":  REM Rapidly search all file sections for new
  160. CASE  88:IF Registered THEN GOSUB "File Search":  REM Search all file sections for new
  161. CASE  89:IF Registered THEN GOSUB "File Search":  REM Search all file sections for keyword
  162. CASE  90:GOSUB "Scavenge":     REM Find inactive one-time callers
  163. CASE  91:GOSUB "Scavenge":     REM Find inactive callers
  164. CASE  92:GOSUB "Search Log":   REM Search part of logfile
  165. CASE  93:GOSUB "Analyze CLog": REM Analyze CallerLog
  166. CASE  94:GOSUB "Print File":   REM Print a textfile, i.e. CallerLog
  167. CASE  95:GOSUB "Last Callers": REM List recent callers
  168. CASE  96:GOSUB "File Search":  REM Search file sections by keyword
  169. CASE  97:GOSUB "Search String":REM Search for string, show one line
  170. CASE  98:GOSUB "Back UserLog": REM Backup UserLog
  171. CASE  99:GOSUB "Change Menu":  REM Exit & run another menu
  172. CASE 100:GOSUB "Exit":         REM Normal exit
  173. CASE 101:GOSUB "No Update":    REM Wipe out LaunchRRH
  174. CASE 102:GOSUB "Exit":         REM Shutdown
  175. CASE 103:GOSUB "Launch App":   REM Run another program
  176. CASE 104:GOSUB "Kill File":    REM Delete a file
  177. CASE 105:GOSUB "Reset":        REM Reset file with datestamp
  178. CASE 106:GOSUB "Reset":        REM Reset file no datestamp
  179. CASE 107:GOSUB "View":         REM Read a log file from end
  180. CASE 108:GOSUB "Name List":    REM Name/From list
  181. CASE 109:GOSUB "Name List":    REM Name/From/Last Call list
  182. CASE 110:GOSUB "Count Users":  REM Count UserLog entries
  183. CASE 111:GOSUB "Name Search":  REM Full UserLog display
  184. CASE 112:GOSUB "Name Search":  REM Like 111, but no password
  185. CASE 113:GOSUB "Name Search":  REM Name/From/Call stats only
  186. CASE 114:GOSUB "Pre Validate": REM Validate user beforehand
  187. CASE 115:GOSUB "Find User":    REM Non-stop UserLog display
  188. CASE 116:GOSUB "List Level":   REM List users by access:
  189. CASE 117:GOSUB "List Time":    REM List users by time:
  190. CASE 118:GOSUB "Location":     REM List users by location/full
  191. CASE 119:GOSUB "Location":     REM List users by location/brief
  192. CASE 120:GOSUB "List DL":      REM List downloaders
  193. CASE 121:GOSUB "Credit Check": REM Analyze user contributions
  194. CASE 122:GOSUB "Search Log":   REM Reverse look for string
  195. CASE 123:GOSUB "Alter Default":REM Change user analysis values
  196. CASE 124:GOSUB "Desktop":      REM Exit Archie to Desktop
  197. CASE 125:GOSUB "Archie Info":  REM About Archie...
  198. CASE 126:GOSUB "Search Log":   REM Look for string in logfile
  199. CASE 127:GOSUB "Directory":    REM Show directory of volumes
  200. CASE 128:GOSUB "Clear SYSMSG": REM Clear Systemx.msg read flags
  201. CASE 129:GOSUB "RestrictFlags":REM Set/clear user restriction flags
  202. CASE 130:GOSUB "Zero Log":     REM Empty out logfile
  203. CASE 131:GOSUB "Clear Log":    REM Clear out logfile prior to today
  204. CASE 132:GOSUB "Clear&Arc Log":REM Clear out logfile prior to today
  205. CASE 133:GOSUB "Clear MsgComb":REM Clear combined message read selection
  206. END SELECT
  207. LONG IF Execute
  208. GOSUB "Echo LF"
  209. GOSUB "Echo LF"
  210. Temp$ = "    Do it again (Y,N)? "
  211. GOSUB "Noline Echo"
  212. GOSUB "Get Reply"
  213. IF Reply$ <> "Y" THEN "Back to Host"
  214. END IF
  215. GOTO "Main Loop"
  216. '
  217. '    ------------- Refresh Window -------------
  218. "Refresh Window"
  219. WINDOW #2
  220. PICTURE ON
  221. PRINT " ";Baud$;" ";ArchCaller$;" from ";FN MakeStr$(From$)
  222. PRINT " Clearance:";ArchClearance;
  223. PRINT " Time Limit:";ArchTime;
  224. Temp$ = NoCalls$
  225. PRINT " Times On:";FN Short;
  226. PICTURE OFF, Pic1&
  227. PICTURE, Pic1&
  228. WINDOW PICTURE #2, Pic1&
  229. WINDOW #3
  230. RETURN
  231. '
  232. '    ------------- Text Display -------------
  233. "Text Display"
  234. Page = 0
  235. GOSUB "Write to CallerLog"
  236. OPEN "I", 1, Option$, 1
  237. LONG IF Command <> 13
  238. GOSUB "Echo LF"
  239. Temp$ = Proceed$
  240. GOSUB "Newline Echo"
  241. END IF
  242. GOSUB "Echo LF"
  243. WHILE (NOT EOF(1)) AND (NOT Interrupt)
  244. READ #1, Temp$;1
  245. LONG IF Temp$ <> CR$
  246. GOSUB "Noline Echo"
  247. XELSE
  248. GOSUB "Echo LF"
  249. LONG IF Command <> 14
  250. Page = Page +1
  251. LONG IF Page = 24
  252. Page = 0
  253. GOSUB "Hit Key to Continue"
  254. GOSUB "Echo LF"
  255. END IF
  256. END IF
  257. END IF
  258. GOSUB "Check Modem"
  259. IF Command <> 13 THEN GOSUB "Check Interrupt"
  260. WEND
  261. CLOSE #1
  262. GOSUB "Echo LF"
  263. GOSUB "Hit Key to Continue"
  264. RETURN
  265. '
  266. '    ------------- Write to CallerLog -------------
  267. "Write to CallerLog"
  268. LONG IF ArchieLocal = FALSE
  269. LONG IF Command <> 103
  270. Temp$ = "Read text file"
  271. XELSE
  272. Temp$ = "Launching external application"
  273. END IF
  274. Temp$ = Temp$ + " <" + Option$ + ">"
  275. LONG IF CallerLog
  276. OPEN "A", 2, CallerLog$
  277. PRINT #2, Temp$
  278. CLOSE #2
  279. XELSE
  280. LONG IF PrintCallerLog
  281. OPEN "C", PPort, 9600
  282. HANDSHAKE PPort, -1
  283. PRINT #PPort, Temp$
  284. CLOSE #PPort
  285. END IF
  286. END IF
  287. END IF
  288. RETURN
  289. '
  290. '    ------------- Reset Files -------------
  291. "Reset"
  292. Temp$ = Option$ + ".Arch"
  293. OPEN "I", 1, Option$, 1
  294. OPEN "A", 2, Temp$, 1
  295. MarkPlace1& = 0
  296. MarkPlace2& = LOF(2,1)
  297. WHILE NOT EOF(1)
  298. RECORD #1, MarkPlace1&
  299. LINE INPUT#1, Temp$
  300. MarkPlace1& = REC(1)
  301. RECORD #2, MarkPlace2&
  302. PRINT #2, Temp$
  303. MarkPlace2& = REC(2)
  304. WEND
  305. CLOSE #1
  306. CLOSE #2
  307. LONG IF MarkPlace1& > 0
  308. OPEN "O", 1, Option$
  309. LONG IF Command = 105
  310. PRINT #1, "Started ";DATE$;" at ";LEFT$(TIME$, 5)
  311. PRINT #1, Dash$
  312. END IF
  313. CLOSE #1
  314. END IF
  315. GOSUB "Echo LF"
  316. Temp$ = Option$
  317. GOSUB "Path Finder"
  318. Temp$ = FName$+" has been reset."
  319. GOSUB "Newline Echo"
  320. GOSUB "Hit Key to Continue"
  321. RETURN
  322. '
  323. '    ------------- Zero Log -------------
  324. "Zero Log"
  325. OPEN "O", 1, Option$
  326. CLOSE #1
  327. Temp$ = Option$
  328. GOSUB "Path Finder"
  329. Temp$ = FName$+" has been zeroed."
  330. GOSUB "Newline Echo"
  331. GOSUB "Hit Key to Continue"
  332. RETURN
  333. '
  334. '    ------------- Clear Log -------------
  335. "Clear Log"
  336. '
  337. Today$ = DATE$
  338. OPEN "I", 1, Option$
  339. Temp$ = Option$ + ".$$$"
  340. OPEN "O", 2, Temp$
  341. WHILE NOT EOF(1)
  342.   LINE INPUT #1, Temp$
  343.   IF INSTR(1, Temp$, Today$) <> 0 THEN PRINT #2, Temp$
  344. WEND
  345. CLOSE #1
  346. CLOSE #2
  347. KILL Option$
  348. Temp$ = Option$ + ".$$$"
  349. RENAME Temp$ TO Option$
  350. Temp$ = Option$
  351. GOSUB "Path Finder"
  352. Temp$ = FName$+" has been cleared."
  353. GOSUB "Newline Echo"
  354. GOSUB "Hit Key to Continue"
  355. RETURN
  356. '
  357. '    ------------- Clear&Arc Log -------------
  358. "Clear&Arc Log"
  359. '
  360. Today$ = DATE$
  361. OPEN "I", 1, Option$
  362. Temp$ = Option$ + ".$$$"
  363. OPEN "O", 2, Temp$
  364. Temp$ = Option$ + ".Arch"
  365. OPEN "A", 3, Temp$
  366. WHILE NOT EOF(1)
  367.   LINE INPUT #1, Temp$
  368.   LONG IF INSTR(1, Temp$, Today$) <> 0
  369.     PRINT #2, Temp$
  370.   XELSE
  371.     PRINT #3, Temp$
  372.   END IF
  373. WEND
  374. CLOSE #1
  375. CLOSE #2
  376. CLOSE #3
  377. KILL Option$
  378. Temp$ = Option$ + ".$$$"
  379. RENAME Temp$ TO Option$
  380. Temp$ = Option$
  381. GOSUB "Path Finder"
  382. Temp$ = FName$+" has been cleared and archived."
  383. GOSUB "Newline Echo"
  384. GOSUB "Hit Key to Continue"
  385. RETURN
  386. '
  387. '    ------------- Clear MsgComb -------------
  388. "Clear MsgComb"
  389. '
  390. GOSUB "UserLog Password"
  391. GOSUB "Echo LF"
  392. LONG IF Password
  393. Temp$ = "This command clears message combined read flags in the UserLog so"
  394. GOSUB "Newline Echo"
  395. Temp$ = "callers will be asked to re-select combined message read sections."
  396. GOSUB "Newline Echo"
  397. GOSUB "Echo LF"
  398. Temp$ = "Are you sure you want to clear message combined read flags? "
  399. GOSUB "Noline Echo"
  400. GOSUB "Get Reply"
  401. IF Reply$ <> CR$ THEN GOSUB "Echo LF"
  402. IF LEFT$(Reply$, 1) <> "Y" THEN "Escape Clear MsgComb"
  403. GOSUB "Echo LF"
  404. Temp$ = StandBy$
  405. GOSUB "Newline Echo"
  406. Temp$ = STRING$(32, 0)
  407. OPEN "R", 1, UserLog$, 136
  408. Location = 0
  409. Limit = LOF(1, 136)
  410. WHILE (Location < Limit) AND (NOT Interrupt)
  411. RECORD #1, Location, 104
  412. WRITE #1, Temp$;32
  413. Location = Location + 1
  414. WEND
  415. CLOSE #1
  416. END IF
  417. "Escape Clear MsgComb"
  418. GOSUB "Hit Key to Continue"
  419. RETURN
  420. '
  421. '    ------------- Print File -------------
  422. "Print File"
  423. SEGMENT
  424. Temp$ = Option$
  425. GOSUB "Path Finder"
  426. IF Port = -2 THEN PPort = -1 ELSE PPort = -2
  427. OPEN "C", PPort, 9600
  428. HANDSHAKE PPort, -1
  429. OPEN "I", 1, Option$, 1
  430. Count = 0
  431. Page = 1
  432. TimeStamp$ = DATE$ + " " + TIME$
  433. WHILE NOT EOF(1)
  434. LONG IF Count = 0
  435. PRINT #PPort, Indent$;FName$;Indent$;TimeStamp$;Indent$;"Page";Page;LF$
  436. PRINT #PPort, LF$
  437. Page = Page + 1
  438. END IF
  439. LINE INPUT#1, Temp$
  440. WHILE LEN(Temp$) > 72
  441. Temp1$ = LEFT$(Temp$, 72)
  442. PRINT #PPort, Indent$;Temp1$;LF$
  443. Count = Count + 1
  444. IF Count = 59 THEN GOSUB "New Page"
  445. Temp$ = "    " + RIGHT$(Temp$, LEN(Temp$) - 72)
  446. WEND
  447. PRINT #PPort, Indent$;Temp$;LF$
  448. Count = Count + 1
  449. IF Count = 59 THEN GOSUB "New Page"
  450. WEND
  451. LONG IF Count > 0
  452. FOR I = Count TO 64
  453. PRINT #PPort, LF$
  454. NEXT I
  455. END IF
  456. CLOSE #PPort
  457. CLOSE #1
  458. SEGMENT RETURN
  459. '
  460. '    ------------- New Page -------------
  461. "New Page"
  462. FOR I = 1 TO 5
  463. PRINT #PPort, LF$
  464. NEXT I
  465. Count = 0
  466. RETURN
  467. '
  468. '    ------------- Choose Viewing Time -------------
  469. "View"
  470. GOSUB "Echo LF"
  471. Temp$ = "Enter a number for how many minutes you want to view the"
  472. GOSUB "Newline Echo"
  473. Temp$ = "file. Type a number (decimals are OK) and hit Return."
  474. GOSUB "Newline Echo"
  475. GOSUB "Echo LF"
  476. Temp$ = "Time? "
  477. GOSUB "Noline Echo"
  478. GOSUB "Get A Line"
  479. IF Reply$ = "" THEN "Leave View"
  480. Reply! = VAL(Reply$)
  481. IF Reply! = 0 THEN "View"
  482. AttSpan& = Reply! * Baud * 6
  483. GOSUB "Write to CallerLog"
  484. OPEN "I", 1, Option$, 1
  485. FLength& = LOF (1,1)
  486. IF FLength& <= AttSpan& THEN FPointer& = 0:Big = FALSE
  487. IF FLength& > AttSpan& THEN FPointer& = FLength& - AttSpan&:Big = TRUE
  488. RECORD 1, FPointer&
  489. LONG IF FLength& > 1
  490. Temp$ = Proceed$
  491. GOSUB "Newline Echo"
  492. GOSUB "Echo LF"
  493. LONG IF Big
  494. WHILE (NOT EOF(1)) AND (Temp$ <> CR$)
  495. READ #1, Temp$;1
  496. WEND
  497. END IF
  498. WHILE (NOT EOF(1)) AND (NOT Interrupt)
  499. READ #1, Temp$;1
  500. LONG IF Temp$ <> CR$
  501. GOSUB "Noline Echo"
  502. XELSE
  503. GOSUB "Echo LF"
  504. END IF
  505. GOSUB "Check Modem"
  506. GOSUB "Check Interrupt"
  507. WEND
  508. XELSE
  509. Temp$ = "File has just been reset!"
  510. GOSUB "Newline Echo"
  511. END IF
  512. CLOSE #1
  513. GOSUB "Hit Key to Continue"
  514. "Leave View"
  515. RETURN
  516. '
  517. '    ------------- Count Users -------------
  518. "Count Users"
  519. OPEN "I", 1, UserLog$, 136
  520. Temp = LOF(1, 136)
  521. CLOSE #1
  522. GOSUB "Echo LF"
  523. Temp$ = "There are "
  524. GOSUB "Noline Echo"
  525. IF Temp <  10 THEN Place% = 1:GOSUB "Format Number"
  526. IF Temp >   9 THEN IF Temp <   100 THEN Place% = 2:GOSUB "Format Number"
  527. IF Temp >  99 THEN IF Temp <  1000 THEN Place% = 3:GOSUB "Format Number"
  528. IF Temp > 999 THEN Place% = 4:GOSUB "Format Number"
  529. Temp$ = Temp$ + " callers in the UserLog."
  530. GOSUB "Newline Echo"
  531. GOSUB "Hit Key to Continue"
  532. RETURN
  533. '
  534. '    ------------- Name Search -------------
  535. "Name Search"
  536. GOSUB "UserLog Password"
  537. GOSUB "Echo LF"
  538. LONG IF Password
  539. Temp$ = "Enter all or part of name to find: "
  540. GOSUB "Noline Echo"
  541. GOSUB "Get A Line"
  542. GOSUB "Echo LF"
  543. IF Reply$ <> "" THEN GOSUB "Find User"
  544. END IF
  545. RETURN
  546. '
  547. '    ------------- Name List -------------
  548. "Name List"
  549. '     This command duplicates Host command 7, but adds last call info
  550. OPEN "I", 1, UserLog$, 136
  551. Count1% = 1
  552. GOSUB "Echo LF"
  553. WHILE (NOT EOF(1)) AND (NOT Interrupt)
  554. GOSUB "Read UserLog Entry"
  555. UserLogLine$(1) = Caller$+" from "
  556. Temp$ = FN MakeStr$(From$)
  557. LONG IF Command = 109
  558. UserLogLine$(1) = UserLogLine$(1) + Temp$ + " last called "
  559. Place% = 2
  560. FOR Count% = 2 TO 3
  561. Temp$ = MID$(LastCall$, Count%, 1)
  562. Temp = ASC(Temp$)
  563. GOSUB "Format Number"
  564. UserLogLine$(1) = UserLogLine$(1) + Temp$ + "/"
  565. NEXT Count%
  566. Temp$ = MID$(LastCall$, 1, 1)
  567. Temp = ASC(Temp$)
  568. GOSUB "Format Number"
  569. END IF
  570. Temp$ = UserLogLine$(1) + Temp$
  571. GOSUB "Newline Echo"
  572. Count1% = Count1% + 1
  573. LONG IF Count1% = 24
  574. Count1% = 1
  575. "Any Input?"
  576. Temp$ = "    Continue (Y,N)? "
  577. GOSUB "Noline Echo"
  578. GOSUB "Get Reply"
  579. IF Reply$ <> CR$ THEN GOSUB "Echo LF"
  580. IF Reply$ = "N" THEN "Later For You"
  581. LONG IF Reply$ <> "Y"
  582. GOSUB "Echo LF"
  583. GOTO "Any Input?"
  584. END IF
  585. END IF
  586. GOSUB "Check Interrupt"
  587. WEND
  588. "Later For You"
  589. CLOSE #1
  590. RETURN
  591. '
  592. '    ------------- Access Level Search -------------
  593. "List Level"
  594. GOSUB "UserLog Password"
  595. GOSUB "Echo LF"
  596. LONG IF Password
  597. Temp$ = "Enter user access level to list: "
  598. GOSUB "Noline Echo"
  599. GOSUB "Get A Line"
  600. Reply = VAL(Reply$)
  601. LONG IF Reply > -1
  602. Temp$ = "Include access levels <E>qual, <G>reater or <L>ess (E,G,L)? "
  603. GOSUB "Noline Echo"
  604. GOSUB "Get A Key"
  605. Relate$ = UCASE$(Hit$)
  606. IF ((Relate$ <> "G") AND (Relate$ <> "L")) THEN Relate$ = "E"
  607. GOSUB "Echo LF"
  608. GOSUB "Echo LF"
  609. GOSUB "Find User"
  610. END IF
  611. END IF
  612. RETURN
  613. '    ------------- Time Search -------------
  614. "List Time"
  615. GOSUB "UserLog Password"
  616. GOSUB "Echo LF"
  617. LONG IF Password
  618. Temp$ = "Enter user time limit to list: "
  619. GOSUB "Noline Echo"
  620. GOSUB "Get A Line"
  621. Reply = VAL(Reply$)
  622. LONG IF Reply <> 0
  623. Temp$ = "Include times <E>qual, <G>reater or <L>ess (E,G,L)? "
  624. GOSUB "Noline Echo"
  625. GOSUB "Get A Key"
  626. Relate$ = UCASE$(Hit$)
  627. IF ((Relate$ <> "G") AND (Relate$ <> "L")) THEN Relate$ = "E"
  628. GOSUB "Echo LF"
  629. GOSUB "Echo LF"
  630. GOSUB "Find User"
  631. END IF
  632. END IF
  633. RETURN
  634. '    ------------- Location Search -------------
  635. "Location"
  636. GOSUB "UserLog Password"
  637. GOSUB "Echo LF"
  638. LONG IF Password
  639. Temp$ = "Enter all or part of location to find: "
  640. GOSUB "Noline Echo"
  641. GOSUB "Get A Line"
  642. GOSUB "Echo LF"
  643. IF Reply$ <> "" THEN GOSUB "Find User"
  644. END IF
  645. RETURN
  646. '
  647. '    ------------- List Downloaders -------------
  648. "List DL"
  649. GOSUB "UserLog Password"
  650. GOSUB "Echo LF"
  651. LONG IF Password
  652. Temp$ = "Downloaders will be shown on the basis of three figures:"
  653. GOSUB "Newline Echo"
  654. Temp$ = "Number of downloads, uploads and public messages."
  655. GOSUB "Newline Echo"
  656. Temp$ = "Archie will display callers who have downloaded "+CheckDL$+" files"
  657. GOSUB "Newline Echo"
  658. Temp$ = "and who have uploaded fewer than "+CheckUL$+" files and who have posted"
  659. GOSUB "Newline Echo"
  660. Temp$ = "fewer than "+CheckMsg$+" messages."
  661. GOSUB "Newline Echo"
  662. GOSUB "Echo LF"
  663. GOSUB "Find User"
  664. END IF
  665. RETURN
  666. '
  667. '    ------------- UserLog Credit Check -------------
  668. "Credit Check"
  669. GOSUB "UserLog Password"
  670. GOSUB "Echo LF"
  671. LONG IF Password
  672. Temp$ = STR$(DLValue)
  673. Temp$ = "The UserLog will be scanned using a formula of"+Temp$+" downloads"
  674. GOSUB "Newline Echo"
  675. Temp$ = STR$(MsgValue!)
  676. Temp$ = "allowed per upload and"+Temp$+" messages equal to one upload."
  677. GOSUB "Newline Echo"
  678. GOSUB "Echo LF"
  679. Temp$ = "Do you want to see Givers or Takers (G,T)? "
  680. GOSUB "Noline Echo"
  681. GOSUB "Get A Key"
  682. Analyze$ = UCASE$(Hit$)
  683. GOSUB "Echo LF"
  684. GOSUB "Echo LF"
  685. LONG IF (Analyze$ = "G" OR Analyze$ = "T")
  686. Temp$ = "Choose a percentage as a guide (100 is a 'balanced' percentage): "
  687. GOSUB "Noline Echo"
  688. GOSUB "Get A Line"
  689. IF Reply$ = "" THEN Merit! = 100 ELSE Merit! = VAL(Reply$)
  690. GOSUB "Echo LF"
  691. GOSUB "Find User"
  692. END IF
  693. END IF
  694. RETURN
  695. '
  696. '    ------------- Find inactive users -------------
  697. "Scavenge"
  698. GOSUB "UserLog Password"
  699. GOSUB "Echo LF"
  700. LONG IF Password
  701. Temp$ = "Archie will search the Userlog for inactive callers. You will"
  702. GOSUB "Newline Echo"
  703. Temp$ = "see callers who have not called back for the period of time you"
  704. GOSUB "Newline Echo"
  705. Temp$ = "specify."
  706. GOSUB "Newline Echo"
  707. GOSUB "Echo LF"
  708. Temp$ = "How many days since the last call? "
  709. GOSUB "Noline Echo"
  710. GOSUB "Get A Line"
  711. Inactive = VAL(Reply$)
  712. IF Inactive <> 0 THEN GOSUB "Find User"
  713. END IF
  714. RETURN
  715. '
  716. '    ------------- Find User -------------
  717. "Find User"
  718. SEGMENT
  719. Target$ = UCASE$(Reply$)
  720. UserFound = FALSE
  721. OPEN "I", 1, UserLog$, 136
  722. RECORD #1, 0
  723. WHILE (NOT EOF(1)) AND (NOT Interrupt)
  724. GOSUB "Read UserLog Entry"
  725. LONG IF Command => 111 AND Command =< 113
  726. IF (Command = 111) THEN UserEdit = TRUE
  727. IF INSTR(1, UCASE$(Caller$), Target$) THEN "Display User Entry"
  728. END IF
  729. LONG IF (Command = 90) OR (Command = 91)
  730. UserDelete = TRUE
  731. LastCall& = 365 * ASC(LEFT$(LastCall$, 1)) + 30.5 * ASC(MID$(LastCall$, 2, 1)) + ASC(MID$(LastCall$, 3, 1))
  732. Temp = Now& - LastCall&
  733. LONG IF Temp > Inactive
  734. IF (NoCalls = 1) AND (Command = 90) THEN "Display User Entry"
  735. IF (Command = 91) THEN "Display User Entry"
  736. END IF
  737. END IF
  738. IF Command = 115 THEN GOSUB "Echo LF":GOTO "Display User Entry"
  739. LONG IF Command = 116
  740. UserEdit = TRUE
  741. IF Relate$ = "E" THEN IF Reply =  Clearance THEN "Display User Entry"
  742. IF Relate$ = "G" THEN IF Reply =< Clearance THEN "Display User Entry"
  743. IF Relate$ = "L" THEN IF Reply => Clearance THEN "Display User Entry"
  744. END IF
  745. LONG IF Command = 117
  746. UserEdit = TRUE
  747. IF Relate$ = "E" THEN IF Reply =  Time THEN "Display User Entry"
  748. IF Relate$ = "G" THEN IF Reply =< Time THEN "Display User Entry"
  749. IF Relate$ = "L" THEN IF Reply => Time THEN "Display User Entry"
  750. END IF
  751. LONG IF (Command = 118) OR (Command = 119)
  752. Temp$ = FN MakeStr$(From$)
  753. IF INSTR(1, UCASE$(Temp$), UCASE$(Reply$)) THEN "Display User Entry"
  754. END IF
  755. LONG IF Command = 120
  756. UserEdit = TRUE
  757. LONG IF DL => CheckDL
  758. LONG IF UL < CheckUL
  759. IF Pub < CheckMsg THEN "Display User Entry"
  760. END IF
  761. END IF
  762. END IF
  763. LONG IF (Command = 121) AND (NoCalls > NewCall) AND (Clearance < Privilege)
  764. UserEdit = TRUE
  765. Credit! = (UL * MsgValue!) + Pub
  766. Credit! = Credit! * DLValue
  767. Credit! = Credit!\MsgValue!
  768. Debit! = DL
  769. LONG IF Debit! = 0
  770. Debit! = 0.1
  771. IF Credit! > 320 THEN Credit! = 320
  772. END IF
  773. Credit! = Credit!\Debit!
  774. Credit! = 100 * Credit!
  775. Credit! = INT(Credit!)
  776. Temp$ = STR$(Credit!)
  777. Credit$ = "Credit Rating is" + Temp$ + "%"
  778. IF (Analyze$ = "G") AND (Credit! => Merit!) THEN "Display User Entry"
  779. IF (Analyze$ = "T") AND (Credit! =< Merit!) AND (DL > 0) THEN "Display User Entry"
  780. END IF
  781. GOTO "Jump Next"
  782. "Display User Entry"
  783. UserFound = TRUE
  784. UserLogLine$(1) = "Name: "+Caller$+"  From: "
  785. Temp$ = FN MakeStr$(From$)
  786. UserLogLine$(1) = UserLogLine$(1) + Temp$
  787. LONG IF ((Command <> 113) AND (Command <> 119))
  788. IF ((ASC(Flag$) AND 64) = 64) THEN Temp$ = "  [Deleted]" ELSE Temp$ = ""
  789. XELSE
  790. Temp$ = ""
  791. END IF
  792. UserLogLine$(1) = UserLogLine$(1) + Temp$
  793. LONG IF Command = 111
  794. Temp$ = FN MakeStr$(PW$)
  795. UserLogLine$(2) = "Pwd: " + Temp$ + "   "
  796. XELSE
  797. UserLogLine$(2) = ""
  798. END IF
  799. UserLogLine$(2) = UserLogLine$(2) + "Calls: "
  800. Temp = NoCalls
  801. Place% = 4
  802. GOSUB "Format Number"
  803. UserLogLine$(2) = UserLogLine$(2) + Temp$ + "  Last Call: "
  804. Place% = 2
  805. FOR Count% = 2 TO 3
  806. Temp$ = MID$(LastCall$, Count%, 1)
  807. Temp = ASC(Temp$)
  808. GOSUB "Format Number"
  809. UserLogLine$(2) = UserLogLine$(2) + Temp$ + "/"
  810. NEXT Count%
  811. Temp$ = MID$(LastCall$, 1, 1)
  812. Temp = ASC(Temp$)
  813. GOSUB "Format Number"
  814. UserLogLine$(2) = UserLogLine$(2) + Temp$
  815. LONG IF ((Command <> 113) AND (Command <> 119))
  816. UserLogLine$(2) = UserLogLine$(2) + "  Time: "
  817. Temp = Time
  818. Place% = 3
  819. GOSUB "Format Number"
  820. UserLogLine$(2) = UserLogLine$(2) + Temp$ + "  Clearance: "
  821. Temp = Clearance
  822. Place% = 3
  823. GOSUB "Format Number"
  824. UserLogLine$(2) = UserLogLine$(2) + Temp$
  825. LONG IF ((Command <> 113) AND (Command <> 119))
  826. GOSUB "Display Restriction"
  827. UserLogLine$(3) = Temp$
  828. END IF
  829. Temp = UL
  830. Place% = 4
  831. GOSUB "Format Number"
  832. UserLogLine$(4) = "Uploads: " + Temp$ + "  Downloads: "
  833. Temp = DL
  834. GOSUB "Format Number"
  835. UserLogLine$(4) = UserLogLine$(4) + Temp$ + "  Priv Msg: "
  836. Temp = Priv
  837. GOSUB "Format Number"
  838. UserLogLine$(4) = UserLogLine$(4) + Temp$ + "  Pub Msg: "
  839. Temp = Pub
  840. GOSUB "Format Number"
  841. UserLogLine$(4) = UserLogLine$(4) + Temp$
  842. END IF
  843. '
  844. IF ((Command = 113) OR (Command = 119)) THEN Bound = 2 ELSE Bound = 4
  845. FOR Count% = 1 TO Bound
  846. Limit% = LEN(UserLogLine$(Count%))
  847. FOR Count2% = 1 TO Limit%
  848. Temp$ = MID$(UserLogLine$(Count%), Count2%, 1)
  849. GOSUB "Noline Echo"
  850. GOSUB "Check Modem"
  851. IF NOT Interrupt THEN GOSUB "Check Interrupt"
  852. IF Interrupt THEN Count2% = Limit%
  853. NEXT Count2%
  854. GOSUB "Echo LF"
  855. IF Interrupt THEN Count% = Bound
  856. NEXT Count%
  857. LONG IF (Command = 121) AND (NOT Interrupt)
  858. Temp$ = Credit$
  859. GOSUB "Newline Echo"
  860. END IF
  861. GOSUB "Echo LF"
  862. IF NonStop THEN "Jump Next"
  863. LONG IF (UserEdit OR UserDelete) AND (MyClearance > Clearance) AND (NOT Interrupt)
  864.   Temp$ = Continue1$  + "(E>dit, D>elete, C>ancel, N>onstop): "
  865. XELSE
  866.   Temp$ = Continue1$  + "(C>ancel, N>onstop): "
  867. END IF
  868. GOSUB "Noline Echo"
  869. GOSUB "Get A Key"
  870. Check$ = UCASE$(Hit$)
  871. IF Check$ <> CR$ THEN GOSUB "Echo LF"
  872. GOSUB "Echo LF"
  873. LONG IF (UserEdit OR UserDelete) AND (MyClearance > Clearance) AND ((Check$ = "E") OR (Check$ = "D"))
  874. PlaceMark = REC(1)
  875. PlaceMark = PlaceMark - 1
  876. CLOSE #1
  877. IF Check$ = "D" THEN "Edit Delete Status"
  878. Temp$ = STR$(Time)
  879. Temp$ = MID$(Temp$, 2, LEN(Temp$) - 1)
  880. Temp$ = "Old time limit = " + Temp$ + ". New time limit (1-255)?  "
  881. GOSUB "Noline Echo"
  882. GOSUB "Get A Line"
  883. Temp = VAL(Reply$)
  884. IF (Temp < 1) OR (Temp > 255) OR (Reply$  = "") THEN "Edit Clearance"
  885. Temp$ = CHR$(Temp)
  886. OPEN "R", 1, UserLog$, 136
  887. RECORD #1, PlaceMark, 80
  888. WRITE #1, Temp$;1
  889. CLOSE #1
  890. "Edit Clearance"
  891. Temp$ = STR$(Clearance)
  892. Temp$ = MID$(Temp$, 2, LEN(Temp$) - 1)
  893. Temp$ = "Old clearance is " + Temp$ + ". New clearance level (0-255)? "
  894. GOSUB "Noline Echo"
  895. GOSUB "Get A Line"
  896. Temp = VAL(Reply$)
  897. LONG IF Temp > 250
  898. Temp$ = "Sorry: you cannot enter a clearance level higher than 250."
  899. GOSUB "Newline Echo"
  900. GOSUB "Echo LF"
  901. GOTO "Edit Clearance"
  902. END IF
  903. LONG IF Temp > ArchClearance
  904. Temp$ = "Sorry: you cannot enter a clearance level higher than your own."
  905. GOSUB "Newline Echo"
  906. GOSUB "Echo LF"
  907. GOTO "Edit Clearance"
  908. END IF
  909. IF (Temp < 0) OR (Temp > 255) OR (Reply$  = "") THEN "Edit Restrictions"
  910. Temp$ = CHR$(Temp)
  911. OPEN "R", 1, UserLog$, 136
  912. RECORD #1, PlaceMark, 81
  913. WRITE #1, Temp$;1
  914. CLOSE #1
  915. "Edit Restrictions"
  916. GOSUB "Display Restriction"
  917. GOSUB "Newline Echo"
  918. Temp$ = "Flag to alter (1-24, Return to quit)? "
  919. GOSUB "Noline Echo"
  920. GOSUB "Get A Line"
  921. GOSUB "Echo LF"
  922. FlagNo = VAL(Reply$)
  923. FlagNo = FlagNo - 1
  924. LONG IF (FlagNo => 0) AND (FlagNo =< 23)
  925. '       find out which of the three bytes to alter
  926. '       (bytes are in reverse order: 99, 98, 97)
  927. Offset = 99 - (FlagNo / 8)
  928. '       find out which bit to alter
  929. Temp1 = (FlagNo MOD 8)
  930. FlagNo = 2^Temp1
  931. OPEN "R", 1, UserLog$, 136
  932. Position = 0
  933. RECORD #1, PlaceMark, Offset
  934. READ #1, Flag$;1
  935. Flag$ = CHR$(ASC(Flag$) XOR FlagNo)
  936. RECORD #1, PlaceMark, Offset
  937. WRITE #1, Flag$;1
  938. RECORD #1, PlaceMark, 97
  939. READ #1, Restriction$;3
  940. CLOSE #1
  941. GOTO "Edit Restrictions"
  942. END IF
  943. "Edit Delete Status"
  944. Flag = ASC(Flag$)
  945. Temp$ = "Delete user (Y,N)? "
  946. GOSUB "Noline Echo"
  947. GOSUB "Get A Key"
  948. GOSUB "Echo LF"
  949. IF Hit$ <> CR$ THEN GOSUB "Echo LF"
  950. Temp$ = UCASE$(Hit$)
  951. IF Temp$ = "Y" THEN Flag = (Flag OR 64) ELSE Flag = (Flag AND 191)
  952. Flag$ = CHR$(Flag)
  953. OPEN "R", 1, UserLog$, 136
  954. RECORD #1, PlaceMark, 85
  955. WRITE #1, Flag$;1
  956. CLOSE #1
  957. "Skip Edit"
  958. PlaceMark = PlaceMark + 1
  959. OPEN "I", 1, UserLog$, 136
  960. RECORD #1, PlaceMark
  961. GOTO "Jump Next"
  962. END IF
  963. IF Check$ = "C" THEN Interrupt = TRUE
  964. LONG IF Check$ = "N"
  965. NonStop = TRUE
  966. Temp$ = Proceed$
  967. GOSUB "Newline Echo"
  968. XELSE
  969. NonStop = FALSE
  970. END IF
  971. GOSUB "Echo LF"
  972. "Jump Next"
  973. GOSUB "Check Modem"
  974. IF NOT Interrupt THEN GOSUB "Check Interrupt"
  975. WEND
  976. CLOSE #1
  977. LONG IF (UserFound = FALSE) AND (NOT Interrupt)
  978. Temp$ = "No matches found."
  979. GOSUB "Newline Echo"
  980. END IF
  981. NonStop = FALSE
  982. UserEdit = FALSE
  983. UserDelete = FALSE
  984. GOSUB "Hit Key to Continue"
  985. SEGMENT RETURN
  986. '
  987. '    ------------- Format Number -------------
  988. '    Next routine converts number into string, lops off leading &
  989. '    trailing spaces and pads left of number with spaces.
  990. "Format Number"
  991. Temp$ = STR$(Temp)
  992. NewText$ = ""
  993. FOR Format% = 1 TO LEN(Temp$)
  994. Text$ = MID$(Temp$, Format%, 1)
  995. IF Text$ <> " " THEN NewText$ = NewText$ + Text$
  996. NEXT Format%
  997. Temp$ = NewText$
  998. WHILE LEN(Temp$) < Place%
  999. Temp$ = " " + Temp$
  1000. WEND
  1001. RETURN
  1002. '
  1003. '    ------------- Display Restriction -------------
  1004. "Display Restriction"
  1005. '      Displays restriction flags.
  1006. Temp$ = Restriction$
  1007. GOSUB "Decode Restriction"
  1008. Temp$ = ""
  1009. FOR FlagsCount% = 23 TO 0 STEP -1
  1010. Divisor& = 2 ^FlagsCount%
  1011. LONG IF (Temp& / Divisor& = 1)
  1012. Temp$ = "X" + Temp$
  1013. Temp& = Temp& - Divisor&
  1014. XELSE
  1015. Temp$ = "0" + Temp$
  1016. END IF
  1017. IF (FlagsCount% > 0) AND (FlagsCount% MOD 4) = 0 THEN Temp$ = " " + Temp$
  1018. NEXT FlagsCount%
  1019. Temp$ = "Restriction Flags 1-24 (0=Clear, X=Set): " + Temp$
  1020. RETURN
  1021. '
  1022. '    ------------- Pre Validate -------------
  1023. SEGMENT
  1024. "Pre Validate"
  1025. GOSUB "UserLog Password"
  1026. GOSUB "Echo LF"
  1027. LONG IF Password
  1028. Temp$ = "First name of caller (15 characters max)? "
  1029. GOSUB "Noline Echo"
  1030. GOSUB "Get A Line"
  1031. IF Reply$ = "" THEN "Leave Pre Validate"
  1032. LONG IF LEN(Reply$) > 15
  1033. Temp$ = "Too long!"
  1034. GOSUB "Newline Echo"
  1035. GOTO "Pre Validate"
  1036. END IF
  1037. FirstName$ = FN EncodeStr$(Reply$)
  1038. IF LEN(FirstName$) < 16 THEN FirstName$ = FirstName$ + STRING$(16 - LEN(FirstName$), 0)
  1039. "Last Name"
  1040. Temp$ = "Last name of caller (15 characters max)? "
  1041. GOSUB "Noline Echo"
  1042. GOSUB "Get A Line"
  1043. IF Reply$ = "" THEN "Leave Pre Validate"
  1044. LONG IF LEN(Reply$) > 15
  1045. Temp$ = "Too long!"
  1046. GOSUB "Newline Echo"
  1047. GOTO "Last Name"
  1048. END IF
  1049. LastName$ = FN EncodeStr$(Reply$)
  1050. IF LEN(LastName$) < 16 THEN LastName$ = LastName$ + STRING$(16 - LEN(LastName$), 0)
  1051. "Calling From"
  1052. Temp$ = "Calling from (30 characters max)? "
  1053. GOSUB "Noline Echo"
  1054. GOSUB "Get A Line"
  1055. IF Reply$ = "" THEN "Leave Pre Validate"
  1056. LONG IF LEN(Reply$) > 30
  1057. Temp$ = "Too long!"
  1058. GOSUB "Newline Echo"
  1059. GOTO "Calling From"
  1060. END IF
  1061. From$ = FN EncodeStr$(Reply$)
  1062. IF LEN(From$) < 31 THEN From$ = From$ + STRING$(31 - LEN(From$), 0)
  1063. "Password"
  1064. Temp$ = "Password (8 characters max)? "
  1065. GOSUB "Noline Echo"
  1066. GOSUB "Get A Line"
  1067. IF Reply$ = "" THEN "Leave Pre Validate"
  1068. LONG IF LEN(Reply$) > 15
  1069. Temp$ = "Too long!"
  1070. GOSUB "Newline Echo"
  1071. GOTO "Password"
  1072. END IF
  1073. Password$ = FN EncodeStr$(Reply$)
  1074. IF LEN(Password$) < 9 THEN Password$ = Password$ + STRING$(9 - LEN(Password$), 0)
  1075. "Time Limit"
  1076. Temp$ = "Time limit (0-255)? "
  1077. GOSUB "Noline Echo"
  1078. GOSUB "Get A Line"
  1079. IF Reply$ = "" THEN "Leave Pre Validate"
  1080. Reply = VAL(Reply$)
  1081. LONG IF Reply > 255
  1082. Temp$ = "Too long!"
  1083. GOSUB "Newline Echo"
  1084. GOTO "Time Limit"
  1085. END IF
  1086. Time$ = CHR$(Reply)
  1087. "Clearance Level"
  1088. Temp$ = "Clearance level (0-250)? "
  1089. GOSUB "Noline Echo"
  1090. GOSUB "Get A Line"
  1091. IF Reply$ = "" THEN "Leave Pre Validate"
  1092. Reply = VAL(Reply$)
  1093. LONG IF Reply > 250
  1094. Temp$ = "That's too high!"
  1095. GOSUB "Newline Echo"
  1096. GOTO "Clearance Level"
  1097. END IF
  1098. LONG IF Reply > ArchClearance
  1099. Temp$ = "Sorry: you cannot enter an access level higher than your own."
  1100. GOSUB "Newline Echo"
  1101. GOTO "Clearance Level"
  1102. END IF
  1103. Clearance$ = CHR$(Reply)
  1104. Temp$ = "One moment, please..."
  1105. GOSUB "Newline Echo"
  1106. OPEN "A", 1, UserLog$, 136, V%
  1107. PRINT #1, FirstName$;LastName$;From$;Password$;
  1108. '    next loop writes zeroes in # of calls and date/time of last call
  1109. FOR Count = 1 TO 8
  1110. PRINT #1, CHR$(0);
  1111. NEXT Count
  1112. PRINT #1, Time$;Clearance$;
  1113. '    next loop writes zeroes in minutes of last call and two reserved bytes
  1114. FOR Count = 1 TO 3
  1115. PRINT #1, CHR$(0);
  1116. NEXT Count
  1117. '    set user flag to CRs only and never clear screen
  1118. PRINT #1, CHR$(129);
  1119. '    next loop writes zeroes in remainder of user record
  1120. FOR Count = 1 TO 50
  1121. PRINT #1, CHR$(0);
  1122. NEXT Count
  1123. CLOSE #1
  1124. "Leave Pre Validate"
  1125. END IF
  1126. SEGMENT RETURN
  1127. '
  1128. '    ------------- Search Log -------------
  1129. "Search Log"
  1130. SEGMENT
  1131. GOSUB "Echo LF"
  1132. Temp$ = Option$
  1133. GOSUB "Path Finder"
  1134. Temp$ = "This command searches "+FName$+" for a string you specify. Caps"
  1135. GOSUB "Newline Echo"
  1136. Temp$ = "and lower case don't matter. If a match is found, 21 lines are"
  1137. GOSUB "Newline Echo"
  1138. Temp$ = "displayed to show text before and after the match."
  1139. GOSUB "Newline Echo"
  1140. GOSUB "Echo LF"
  1141. "Search Loop 1"
  1142. Temp$ = "String to find " + Return$ + "? "
  1143. GOSUB "Noline Echo"
  1144. GOSUB "Get A Line"
  1145. IF Reply$ = "" THEN "Leave Search Log"
  1146. GOSUB "Echo LF"
  1147. LookFor$ = Reply$
  1148. MarkPlace1& = 0
  1149. StringFound% = FALSE
  1150. NoStringFound% = TRUE
  1151. FirstRead% = TRUE
  1152. OPEN "I", 1, Option$, 1, V%
  1153. LONG IF Command = 92
  1154. Temp$ = "If you want to search all of the file, enter 100, otherwise you"
  1155. GOSUB "Newline Echo"
  1156. Temp$ = "can scan only a percentage of the last part of the file."
  1157. GOSUB "Newline Echo"
  1158. Temp$ = "What percent of the file do you want to search (1-100)? "
  1159. GOSUB "Noline Echo"
  1160. GOSUB "Get A Line"
  1161. IF Reply$ = "" THEN CLOSE #1:GOTO "Leave Search Log"
  1162. Temp! = VAL(Reply$) + 0.5
  1163. IF Temp! < 1 THEN CLOSE #1:GOTO "Leave Search Log"
  1164. GOSUB "Echo LF"
  1165. LONG IF Temp! <= 100
  1166. FileLength! = LOF(1)
  1167. MarkPlace1& = FileLength! - ((Temp!\100.) * FileLength!)
  1168. RECORD #1, MarkPlace1&
  1169. WHILE (NOT EOF(1)) AND (Temp$ <> CR$)
  1170. READ #1, Temp$;1
  1171. WEND
  1172. MarkPlace1& = REC(1)
  1173. END IF
  1174. END IF
  1175. Temp$ = Proceed$
  1176. GOSUB "Newline Echo"
  1177. GOSUB "Echo LF"
  1178. LONG IF Command = 122
  1179. HoldPlace& = LOF(1,1) - 1
  1180. Pointer = 21
  1181. Text$(21) = EndFile$
  1182. XELSE
  1183. Pointer = 1
  1184. Text$(1) = BeginFile$
  1185. END IF
  1186. "Search Loop 2"
  1187. LONG IF Command = 122
  1188. GOSUB "Search Backwards"
  1189. GOTO "Next Stop"
  1190. END IF
  1191. WHILE (NOT EOF(1)) AND (NOT Interrupt) AND (NOT StringFound%)
  1192. Count% = Pointer
  1193. RECORD #1, MarkPlace1&
  1194. GOSUB "Check Modem"
  1195. Count% = Count% + 1
  1196. IF Count% = 22 THEN Count% = 1
  1197. LINE INPUT #1, Text$(Count%)
  1198. MarkPlace1& = REC(1)
  1199. Pointer = Count%
  1200. IF Count% > 11 THEN FirstRead% = FALSE
  1201. LONG IF INSTR(1, UCASE$(Text$(Count%)), LookFor$)
  1202. LONG IF NOT FirstRead%
  1203. BeginDisplay = Count% - 10
  1204. XELSE
  1205. BeginDisplay = 1
  1206. END IF
  1207. IF BeginDisplay < 1 THEN BeginDisplay = BeginDisplay + 21
  1208. StringFound% = TRUE
  1209. NoStringFound% = FALSE
  1210. Temp = 1
  1211. WHILE (NOT EOF(1)) AND (Temp < 11)
  1212. Count% = Count% + 1
  1213. IF Count% = 22 THEN Count% = 1
  1214. LINE INPUT #1, Text$(Count%)
  1215. Temp = Temp + 1
  1216. WEND
  1217. END IF
  1218. GOSUB "Check Interrupt"
  1219. WEND
  1220. EndDisplay = Count%
  1221. "Next Stop"
  1222. GOSUB "Show 21 Lines"
  1223. IF (Command = 122) AND (MarkPlace1& < 1) THEN Temp% = TRUE
  1224. IF (Command <> 122) THEN Temp% = EOF(1)
  1225. LONG IF (NOT Temp%) AND (NOT Interrupt)
  1226. StringFound% = FALSE
  1227. GOSUB "Echo LF"
  1228. Temp$ = Continue1$ + Return$ + ": "
  1229. GOSUB "Noline Echo"
  1230. GOSUB "Get A Key"
  1231. IF Hit$ <> CR$ THEN GOSUB "Echo LF"
  1232. GOSUB "Echo LF"
  1233. IF Command = 122 AND (MarkPlace1& < 0) THEN "Over The Top"
  1234. IF (Hit$ <> CR$) THEN "Search Loop 2"
  1235. "Over The Top"
  1236. END IF
  1237. CLOSE #1
  1238. GOSUB "Echo LF"
  1239. LONG IF NoStringFound% = TRUE AND NOT Interrupt
  1240. Temp$ = "No matching string found."
  1241. GOSUB "Newline Echo"
  1242. GOSUB "Echo LF"
  1243. END IF
  1244. IF NOT Interrupt THEN "Search Loop 1"
  1245. GOSUB "Hit Key to Continue"
  1246. "Leave Search Log"
  1247. SEGMENT RETURN
  1248. '
  1249. '    ------------- Display Log Line -------------
  1250. "Display Log Line"
  1251. Limit% = LEN(Text$(Count%))
  1252. LONG IF Limit%
  1253. FOR Display% = 1 TO Limit%
  1254. Temp$ = MID$(Text$(Count%), Display%, 1)
  1255. GOSUB "Noline Echo"
  1256. GOSUB "Check Interrupt"
  1257. IF Interrupt THEN Display% = Limit%
  1258. NEXT Display%
  1259. END IF
  1260. GOSUB "Echo LF"
  1261. RETURN
  1262. '
  1263. '    ------------- Show 21 Lines -------------
  1264. "Show 21 Lines"
  1265. LONG IF StringFound% AND (NOT Interrupt)
  1266. LONG IF Command = 122 AND (MarkPlace1& < 0)
  1267. Temp$ = BeginFile$
  1268. GOSUB "Newline Echo"
  1269. END IF
  1270. LONG IF BeginDisplay < EndDisplay
  1271. FOR Count% = BeginDisplay TO EndDisplay
  1272. GOSUB "Display Log Line"
  1273. IF Interrupt THEN Count% = EndDisplay
  1274. NEXT Count%
  1275. XELSE
  1276. FOR Count% = BeginDisplay TO 21
  1277. GOSUB "Display Log Line"
  1278. IF Interrupt THEN Count% = 21
  1279. NEXT Count%
  1280. LONG IF NOT Interrupt
  1281. FOR Count% = 1 TO EndDisplay
  1282. GOSUB "Display Log Line"
  1283. IF Interrupt THEN Count% = EndDisplay
  1284. NEXT Count%
  1285. END IF
  1286. END IF
  1287. LONG IF EOF(1) AND (NOT Interrupt) AND (Command <> 122)
  1288. Temp$ = EndFile$
  1289. GOSUB "Newline Echo"
  1290. END IF
  1291. END IF
  1292. RETURN
  1293. '
  1294. '    ------------- Search Backwards -------------
  1295. "Search Backwards"
  1296. MarkPlace1& = HoldPlace&
  1297. WHILE (MarkPlace1& > -1) AND (NOT Interrupt) AND (NOT StringFound%)
  1298. Count% = Pointer - 1
  1299. IF Count% = 0 THEN Count% = 21
  1300. GOSUB "Build a Line"
  1301. Text$(Count%) = Temp$
  1302. Pointer = Count%
  1303. IF Count% < 11 THEN FirstRead% = FALSE
  1304. LONG IF INSTR(1, UCASE$(Text$(Count%)), LookFor$)
  1305. HoldPlace& = MarkPlace1&
  1306. LONG IF NOT FirstRead%
  1307. BeginDisplay = Count% - 10
  1308. IF BeginDisplay < 1 THEN BeginDisplay = BeginDisplay + 21
  1309. XELSE
  1310. BeginDisplay = 1
  1311. END IF
  1312. StringFound% = TRUE
  1313. NoStringFound% = FALSE
  1314. Temp1 = 1
  1315. WHILE (NOT EOF(1)) AND (Temp1 < 11)
  1316. Count% = Count% - 1
  1317. IF Count% = 0 THEN Count% = 21
  1318. GOSUB "Build a Line"
  1319. Text$(Count%) = Temp$
  1320. Temp1 = Temp1 + 1
  1321. WEND
  1322. END IF
  1323. GOSUB "Check Modem"
  1324. GOSUB "Check Interrupt"
  1325. WEND
  1326. BeginDisplay = Count%
  1327. LONG IF NOT FirstRead%
  1328. EndDisplay = BeginDisplay - 1
  1329. IF EndDisplay = 0 THEN EndDisplay = 21
  1330. XELSE
  1331. EndDisplay = 21
  1332. END IF
  1333. RETURN
  1334. '
  1335. '    ------------- Build a Line -------------
  1336. "Build a Line"
  1337. Temp$ = ""
  1338. Temp1$ = ""
  1339. WHILE (MarkPlace1& > -1)
  1340. RECORD #1, MarkPlace1&
  1341. READ #1, Temp1$;1
  1342. MarkPlace1& = MarkPlace1& - 1
  1343. IF (Temp1$ = CR$) THEN "Stop Building"
  1344. Temp$ = Temp1$ + Temp$
  1345. WEND
  1346. "Stop Building"
  1347. RETURN
  1348. '
  1349. '    ------------- Search for a String, Show One Line -------------
  1350. "Search String"
  1351. GOSUB "Echo LF"
  1352. Temp$ = "String to find " + Return$ + "? "
  1353. GOSUB "Noline Echo"
  1354. GOSUB "Get A Line"
  1355. GOSUB "Echo LF"
  1356. LONG IF Reply$ <> ""
  1357. LookFor$ = Reply$
  1358. OPEN "I", 1, Option$
  1359. Temp$ = Proceed$
  1360. GOSUB "Newline Echo"
  1361. GOSUB "Echo LF"
  1362. WHILE (NOT EOF(1)) AND (NOT Interrupt)
  1363. LINE INPUT #1, Temp$
  1364. IF (INSTR(1, UCASE$(Temp$), LookFor$) > 0) GOSUB "Newline Echo"
  1365. GOSUB "Check Interrupt"
  1366. GOSUB "Check Modem"
  1367. WEND
  1368. CLOSE #1
  1369. IF (NOT Interrupt) THEN GOSUB "Hit Key to Continue"
  1370. END IF
  1371. RETURN
  1372. '
  1373. '    ------------- File Search -------------
  1374. SEGMENT
  1375. "File Search"
  1376. ON ERROR GOSUB "FSection Error"
  1377. WhatsNew = 0
  1378. LookFor$ = ""
  1379. FirstTime = TRUE
  1380. OneByOne = TRUE
  1381. GOSUB "Echo LF"
  1382. LONG IF (Command = 89) OR (Command = 96)
  1383. Temp$ = "String to find " + Return$ + "? "
  1384. GOSUB "Noline Echo"
  1385. GOSUB "Get A Line"
  1386. GOSUB "Echo LF"
  1387. IF (Reply$ = "") THEN "Exit File Search"
  1388. LookFor$ = Reply$
  1389. XELSE:         REM Command = 87 or 88
  1390. MDY$ = DATE$
  1391. GOSUB "Decode Date String"
  1392. GOSUB "Count the Days"
  1393. NowaDays& = Day% + (Year% * 365.25)
  1394. Temp$ = "Look at files: N>ew since last call, R>ecently uploaded (N,R)? "
  1395. GOSUB "Noline Echo"
  1396. GOSUB "Get Reply"
  1397. GOSUB "Echo LF"
  1398. GOSUB "Echo LF"
  1399. LONG IF Reply$ = "N"
  1400. WhatsNew = 1 + NowaDays& - ArchLastCall&
  1401. LONG IF (WhatsNew > 182)
  1402. GOSUB "Echo LF"
  1403. Temp$ = "Your last call was too long ago!"
  1404. GOSUB "Newline Echo"
  1405. GOTO "Exit File Search"
  1406. END IF
  1407. XELSE: REM User chose R>ecent uploads option
  1408. LONG IF Reply$ <> "R"
  1409. GOTO "Exit File Search"
  1410. END IF
  1411. Temp$ = "How many days back (1-180) " + Return$ + "? "
  1412. GOSUB "Noline Echo"
  1413. GOSUB "Get A Line"
  1414. GOSUB "Echo LF"
  1415. WhatsNew = VAL(Reply$)
  1416. IF (WhatsNew < 1) OR (WhatsNew > 180) THEN "Exit File Search"
  1417. END IF
  1418. END IF
  1419. LONG IF Command <> 96
  1420. OPEN "I", 2, Option$,, F%
  1421. LINE INPUT #2, Option$
  1422. LINE INPUT #2, Section$
  1423. END IF
  1424. "File Search Loop"
  1425. OPEN "I", 1, Option$, 920, V%
  1426. NoHit = TRUE
  1427. LONG IF FirstTime
  1428. Temp$ = Proceed$
  1429. GOSUB "Newline Echo"
  1430. GOSUB "Echo LF"
  1431. END IF
  1432. FirstTime = FALSE
  1433. DoneHere = FALSE
  1434. IF (Command = 87) AND (LOF(1) > 0) THEN RECORD #1, (LOF(1) - 1)
  1435. MarkPlace1& = REC(1)
  1436. WHILE (NOT EOF(1)) AND (NOT Interrupt) AND (NOT DoneHere) AND (LOF(1) > 0)
  1437. ShowFlag = FALSE
  1438. READ #1, Delete$;1,FSec$;13,FLen$;4,FType$;1,WhoSent$;32,Ver$;10
  1439. READ #1, WhenUL$;6,Clearance$;1,Path$;81,Junk$;1,DL$;4,LastDL$;6
  1440. FOR Count = 1 TO 10
  1441. READ #1, FSec$(Count);76
  1442. LONG IF (LEFT$(FSec$(Count), 1) > CHR$(0))
  1443. FSec$(Count) = FN MakeStr$(FSec$(Count))
  1444. XELSE
  1445. FSec$(Count) = ""
  1446. END IF
  1447. LONG IF ((Command = 89) OR (Command = 96)) AND (ArchClearance => ASC(Clearance$))
  1448. LONG IF FSec$(Count) <> "" AND (ASC(Delete$) = 0)
  1449. IF (INSTR(1, UCASE$(FSec$(Count)), LookFor$) > 0) THEN ShowFlag = TRUE
  1450. END IF
  1451. END IF
  1452. NEXT Count
  1453. '      If the file is active...
  1454. LONG IF (ASC(Delete$) = 0)
  1455. FSec$ = FN MakeStr$(FSec$)
  1456. LONG IF ((Command = 89) OR (Command = 96)) AND (ArchClearance => ASC(Clearance$))
  1457. IF (INSTR(1, UCASE$(FSec$), LookFor$) > 0) THEN ShowFlag = TRUE
  1458. END IF
  1459. LONG IF ((Command = 87) OR (Command = 88)) AND (ArchClearance => ASC(Clearance$))
  1460. Month% = ASC(MID$(WhenUL$, 1, 1))
  1461. Day% = ASC(MID$(WhenUL$, 2, 1))
  1462. Year% = ASC(MID$(WhenUL$, 3, 1))
  1463. GOSUB "Count the Days"
  1464. FileGotHere& = Day% + (Year% * 365.25)
  1465. Qualify% = NowaDays& - FileGotHere&
  1466. IF Qualify% < WhatsNew THEN ShowFlag = TRUE
  1467. END IF
  1468. IF (LEFT$(FSec$(1), 1) = "*") AND (ArchClearance < 200) THEN ShowFlag = FALSE
  1469. LONG IF ShowFlag
  1470. NoHit = FALSE
  1471. Temp = LEN(FSec$)
  1472. IF Temp < 12 THEN FSec$ = FSec$ + SPACE$(12 - Temp)
  1473. Long$ = FLen$
  1474. GOSUB "Decode Long"
  1475. Long& = (Long& + 512) / 1024
  1476. FLen$ = STR$(Long&)
  1477. FLen$ = RIGHT$(FLen$, LEN(FLen$) - 1)
  1478. IF FLen$ = "0" THEN FLen$ = "<1"
  1479. FLen$ = FLen$ + "K  "
  1480. Temp = LEN(FLen$)
  1481. IF LEN(FLen$) < 6 THEN FLen$ = FLen$ + SPACE$(6 - Temp)
  1482. Source$ = WhenUL$
  1483. GOSUB "Make Date String"
  1484. WhenUL$ = DateTime$
  1485. Source$ = LastDL$
  1486. GOSUB "Make Date String"
  1487. LastDL$ = DateTime$
  1488. FType = ASC(FType$)
  1489. SELECT CASE FType
  1490. CASE 0
  1491. FType$ = "Macintosh Application"
  1492. CASE 1
  1493. FType$ = "Macintosh Document"
  1494. CASE 2
  1495. FType$ = "Non-Macintosh File"
  1496. CASE 3
  1497. FType$ = "Plain Text File"
  1498. END SELECT
  1499. Ver$ = FN MakeStr$(Ver$)
  1500. Temp = LEN(Ver$)
  1501. LONG IF Temp = 0
  1502. Ver$ = "[none]   "
  1503. Temp = 9
  1504. END IF
  1505. IF LEN(Ver$) < 9 THEN Ver$ = Ver$ + SPACE$(9 - Temp)
  1506. GOSUB "Check Interrupt"
  1507. LONG IF NOT Interrupt
  1508. Temp$ = "Title: "+FSec$+"  Size: "+FLen$+"  Version: "+Ver$+"  Uploaded: "+WhenUL$
  1509. GOSUB "Newline Echo"
  1510. END IF
  1511. Long$ = DL$
  1512. GOSUB "Decode Long"
  1513. Long$ = STR$(Long&)
  1514. DL$ = RIGHT$(Long$, LEN(Long$) -1)
  1515. WHILE LEN(DL$) < 4
  1516. DL$ = DL$ + " "
  1517. WEND
  1518. WhoSent$ = FN MakeStr$(WhoSent$)
  1519. GOSUB "Check Interrupt"
  1520. LONG IF NOT Interrupt
  1521. Temp$ = "Downloads: "+DL$+"  Last Download: "+LastDL$+"  Uploader: "+WhoSent$
  1522. GOSUB "Newline Echo"
  1523. LONG IF Command <> 96
  1524. Temp$ = "Location: " + Section$
  1525. GOSUB "Newline Echo"
  1526. END IF
  1527. END IF
  1528. FOR Count = 1 TO 10
  1529. LONG IF FSec$(Count) <> ""
  1530. Temp$ = FSec$(Count)
  1531. GOSUB "Newline Echo"
  1532. END IF
  1533. GOSUB "Check Interrupt"
  1534. IF Interrupt THEN Count = 10
  1535. NEXT Count
  1536. GOSUB "Echo LF"
  1537. END IF
  1538. END IF
  1539. GOSUB "Check Interrupt"
  1540. GOSUB "Check Modem"
  1541. IF (OneByOne AND ShowFlag) THEN GOSUB "FSec Reply"
  1542. LONG IF Command = 87
  1543. LONG IF MarkPlace1& > 0
  1544. MarkPlace1& = MarkPlace1& - 1
  1545. RECORD #1, MarkPlace1&
  1546. XELSE
  1547. DoneHere = TRUE
  1548. END IF
  1549. IF ShowFlag = FALSE THEN DoneHere = TRUE
  1550. END IF
  1551. WEND
  1552. LONG IF (Command <> 96)
  1553. LONG IF NoHit AND (NOT Interrupt)
  1554. Temp$ = "[No match in " + Section$ + "]"
  1555. GOSUB "Newline Echo"
  1556. GOSUB "Echo LF"
  1557. END IF
  1558. LONG IF NOT EOF(2)
  1559. CLOSE #1
  1560. "FSec Closed"
  1561. Option$ = ""
  1562. Section$ = ""
  1563. LINE INPUT #2, Option$
  1564. IF NOT EOF(2) THEN LINE INPUT #2, Section$
  1565. IF (Option$ <> "") AND (Section$ <> "") THEN GOTO "File Search Loop"
  1566. END IF
  1567. CLOSE #2
  1568. XELSE: REM Command = 96
  1569. LONG IF NoHit AND (NOT Interrupt)
  1570. Temp$ = "[No match]"
  1571. GOSUB "Newline Echo"
  1572. GOSUB "Echo LF"
  1573. END IF
  1574. END IF
  1575. CLOSE #1
  1576. IF (NOT Interrupt) THEN GOSUB "Hit Key to Continue"
  1577. "Exit File Search"
  1578. ON ERROR GOSUB "Exit"
  1579. SEGMENT RETURN
  1580. '
  1581. '    ------------- FSec Reply -------------
  1582. "FSec Reply"
  1583. Temp$ = NextQuitCont$
  1584. GOSUB "Noline Echo"
  1585. GOSUB "Get Reply"
  1586. GOSUB "Echo LF"
  1587. IF Reply$ = "N" THEN "FSec Escape"
  1588. IF Reply$ = CR$ THEN "FSec Escape No LF"
  1589. LONG IF Reply$ = "Q"
  1590. Interrupt = TRUE
  1591. GOTO "FSec Escape"
  1592. END IF
  1593. LONG IF Reply$ = "C"
  1594. OneByOne = FALSE
  1595. GOTO "FSec Escape"
  1596. END IF
  1597. GOTO "FSec Reply"
  1598. "FSec Escape"
  1599. GOSUB "Echo LF"
  1600. "FSec Escape No LF"
  1601. RETURN
  1602. '
  1603. '    ------------- Make Date String -------------
  1604. "Make Date String"
  1605. Index = 1
  1606. GOSUB "Justify"
  1607. DateTime$ = Temp$ + "/"
  1608. Index = 2
  1609. GOSUB "Justify"
  1610. DateTime$ = DateTime$ + Temp$ + "/"
  1611. Index = 3
  1612. GOSUB "Justify"
  1613. DateTime$ = DateTime$ + Temp$
  1614. RETURN
  1615. '
  1616. '    ------------- Justify -------------
  1617. "Justify"
  1618. Temp$ = STR$(ASC(MID$(Source$, Index, 1)))
  1619. Temp$ = RIGHT$(Temp$, LEN(Temp$) - 1)
  1620. IF LEN(Temp$) = 1 THEN Temp$ = "0" + Temp$
  1621. RETURN
  1622. '
  1623. '    ------------- Decode Long -------------
  1624. "Decode Long"
  1625. Long& = 0
  1626. FOR Count% = 1 TO 4
  1627. Temp1$ = MID$(Long$, Count%, 1)
  1628. Long& = (ASC(Temp1$) * 256^(4 - Count%)) + Long&
  1629. NEXT Count%
  1630. RETURN
  1631. '
  1632. '    ------------- Read Directory -------------
  1633. SEGMENT
  1634. "Directory"
  1635. '
  1636. OneDir = FALSE
  1637. GOSUB "Echo LF"
  1638. Temp$ = "Do you want to see the contents of a Specific directory or of"
  1639. GOSUB "Newline Echo"
  1640. Temp$ = "All mounted volumes? <S,A> "
  1641. GOSUB "Noline Echo"
  1642. GOSUB "Get Reply"
  1643. GOSUB "Echo LF"
  1644. GOSUB "Echo LF"
  1645. LONG IF Reply$ = "S"
  1646. OneDir = TRUE
  1647. GOTO "One Directory"
  1648. END IF
  1649. Temp$ = "This command displays the directories of all mounted volumes. This"
  1650. GOSUB "Newline Echo"
  1651. Temp$ = "may take a while. Do you want to see the directories? <Y/N> "
  1652. GOSUB "Noline Echo"
  1653. GOSUB "Get Reply"
  1654. IF Reply$ = "N" THEN "Exit Dir"
  1655. '    The following routine was borrowed from samples supplied with ZBasic.
  1656. '    It's poorly annotated and hastily adapted, but it works.
  1657. GOSUB "Echo LF"
  1658. GOSUB "Echo LF"
  1659. Temp$ = Proceed$
  1660. GOSUB "Newline Echo"
  1661. GOSUB "Echo LF"
  1662. L = 0
  1663. L2 = 0
  1664. Temp$ = "Path:filenames"
  1665. GOSUB "Newline Echo"
  1666. FOR Count& = 1 TO 10000
  1667. VolumeID$ = FILES$(-Count&,"",,V%)
  1668. LONG IF (V% = 0) OR (VolumeID$ = "")
  1669. Count& = 10000
  1670. XELSE
  1671. GOSUB "Echo LF"
  1672. Volume$(L) = VolumeID$
  1673. L = L+1
  1674. L2 = L
  1675. "DirLoop"
  1676. IF L > L2 THEN L2 = L2 + 1:VolumeID$ = Volume$(L2-1)
  1677. FOR Count2& = 1 TO 10000
  1678. FileID$=FILES$(-Count2&,"",VolumeID$,V%)
  1679. LONG IF FileID$ = ""
  1680. Count2& = 10000
  1681. XELSE
  1682. LONG IF RIGHT$(FileID$,1) <> ":"
  1683. Temp$ = VolumeID$ + FileID$
  1684. GOSUB "Newline Echo"
  1685. END IF
  1686. GOSUB "Check Modem"
  1687. Colon$ = RIGHT$(FileID$,1)
  1688. LONG IF Colon$ = ":"
  1689. Volume$(L) = VolumeID$ + FileID$
  1690. L = L+1
  1691. END IF
  1692. END IF
  1693. GOSUB "Check Interrupt"
  1694. IF Interrupt THEN Count2& = 10000:L2 = L:Count& = 10000
  1695. NEXT Count2&
  1696. IF L2 < L THEN "DirLoop"
  1697. END IF
  1698. NEXT Count&
  1699. GOSUB "Echo LF"
  1700. "One Directory"
  1701. LONG IF OneDir = TRUE
  1702. FileFound = FALSE
  1703. Temp$ = "Volume to show? "
  1704. GOSUB "Noline Echo"
  1705. GOSUB "Get A Line"
  1706. IF Reply$ = "" THEN "No Dir"
  1707. Volume$ = Reply$
  1708. IF RIGHT$(Volume$, 1) <> ":" THEN Volume$ = Volume$ + ":"
  1709. Temp$ = Proceed$
  1710. GOSUB "Newline Echo"
  1711. GOSUB "Echo LF"
  1712. FOR Count% = 1 TO 5000
  1713. Temp$ = FILES$(-Count%,"",Volume$,V%)
  1714. LONG IF Temp$ <> ""
  1715. FileFound = TRUE
  1716. GOSUB "Newline Echo"
  1717. XELSE
  1718. LONG IF (FileFound = FALSE)
  1719. Temp$ = "Directory is undefined or empty."
  1720. GOSUB "Newline Echo"
  1721. END IF
  1722. Count% = 5000
  1723. END IF
  1724. GOSUB "Check Modem"
  1725. GOSUB "Check Interrupt"
  1726. IF Interrupt THEN Count% = 5000
  1727. NEXT Count%
  1728. GOSUB "Echo LF"
  1729. IF (NOT Interrupt) THEN "One Directory"
  1730. END IF
  1731. "No Dir"
  1732. REM   Following lines return default filepath to Host volume.
  1733. REM   (It can be reset by the Directory command.)
  1734. Count% = 1
  1735. DO
  1736. FileID$ = FILES$(-Count%,"",HostPath$,V%)
  1737. Count% = Count% + 1
  1738. UNTIL (FileID$ = HostName$) OR (FileID$ = "")
  1739. LONG IF FileID$ = ""
  1740. Temp$ = "Can't find Host!"
  1741. GOSUB "Newline Echo"
  1742. Temp$ = "Hit any key to reset system"
  1743. GOSUB "Newline Echo"
  1744. GOSUB "Get A Key"
  1745. GOTO "Argh!"
  1746. END IF
  1747. "Exit Dir"
  1748. GOSUB "Hit Key to Continue"
  1749. SEGMENT RETURN
  1750. '
  1751. '    ------------- Kill a File -------------
  1752. "Kill File"
  1753. GOSUB "Echo LF"
  1754. Temp$ = "Enter path:filename of file to delete: "
  1755. GOSUB "Noline Echo"
  1756. GOSUB "Get A Line"
  1757. LONG IF Reply$ <> ""
  1758. Kill$ = Reply$
  1759. Temp$ = "Do you *really* want to delete " + Kill$ + "? "
  1760. GOSUB "Noline Echo"
  1761. Temp$ = Reply$
  1762. GOSUB "Get A Line"
  1763. LONG IF LEFT$(Reply$,1) = "Y"
  1764. KILL Kill$
  1765. Temp$ = Kill$ + " has been deleted."
  1766. GOSUB "Newline Echo"
  1767. END IF
  1768. END IF
  1769. GOSUB "Hit Key to Continue"
  1770. RETURN
  1771. '
  1772. '    ------------- Backup UserLog -------------
  1773. "Back UserLog"
  1774. GOSUB "UserLog Password"
  1775. GOSUB "Echo LF"
  1776. LONG IF Password
  1777. Deleted = 0
  1778. DEF OPEN = "ULOGULED"
  1779. MarkPlace1& = 0
  1780. MarkPlace2& = 0
  1781. OPEN "I", 1, UserLog$, 136
  1782. Temp$ = UserLog$
  1783. GOSUB "Path Finder"
  1784. UserLogPath$ = Temp$
  1785. Temp$ = UserLogPath$ + "UserLog.bak"
  1786. OPEN "O", 2, Temp$, 136
  1787. GOSUB "Echo LF"
  1788. Temp$ = StandBy$
  1789. GOSUB "Newline Echo"
  1790. GOSUB "Echo LF"
  1791. WHILE NOT EOF(1)
  1792. RECORD #1, MarkPlace1&
  1793. READ #1, Temp$;136
  1794. MarkPlace1& = REC(1)
  1795. Flag$ = MID$(Temp$, 86, 1)
  1796. LONG IF ((ASC(Flag$) AND 64) = 64)
  1797. Deleted = Deleted + 1
  1798. GOTO "Skip User"
  1799. END IF
  1800. RECORD #2, MarkPlace2&
  1801. WRITE #2, Temp$;136
  1802. MarkPlace2& = REC(2)
  1803. "Skip User"
  1804. WEND
  1805. CLOSE 1
  1806. CLOSE 2
  1807. DEF OPEN = "TEXTQED1"
  1808. Temp$ = UserLogPath$ + "UserLog.$$$"
  1809. RENAME UserLog$ TO Temp$
  1810. Temp$ = UserLogPath$ + "UserLog.bak"
  1811. RENAME Temp$ TO UserLog$
  1812. Temp$ = UserLogPath$ + "UserLog.$$$"
  1813. Temp1$ = UserLogPath$ + "UserLog.bak"
  1814. RENAME Temp$ TO Temp1$
  1815. GOSUB "Echo LF"
  1816. Place% = 0
  1817. Temp = Deleted
  1818. GOSUB "Format Number"
  1819. Temp$ = Temp$ + " users were deleted."
  1820. GOSUB "Newline Echo"
  1821. GOSUB "Echo LF"
  1822. GOSUB "Flush Keystrokes"
  1823. Temp$ = "Do you want to erase the UserLog backup (Y,N)? "
  1824. GOSUB "Noline Echo"
  1825. GOSUB "Get A Line"
  1826. GOSUB "Echo LF"
  1827. LONG IF UCASE$(LEFT$(Reply$, 1)) = "Y"
  1828. Temp$ = UserLogPath$ + "UserLog.bak"
  1829. KILL Temp$
  1830. END IF
  1831. END IF
  1832. RETURN
  1833. '
  1834. '    ------------- Clear SYSMSG -------------
  1835. "Clear SYSMSG"
  1836. GOSUB "UserLog Password"
  1837. GOSUB "Echo LF"
  1838. LONG IF Password
  1839. Temp$ = "This command clears message flags in the UserLog so your callers"
  1840. GOSUB "Newline Echo"
  1841. Temp$ = "will see one or more freshly-posted SYSTEMx.MSGs."
  1842. GOSUB "Newline Echo"
  1843. GOSUB "Echo LF"
  1844. Temp$ = "Clear SYSTEM.MSG 1, 2, 3, All or Quit (1, 2, 3, A, Q)? "
  1845. GOSUB "Noline Echo"
  1846. GOSUB "Get Reply"
  1847. IF Reply$ <> CR$ THEN GOSUB "Echo LF"
  1848. SysMsgFlag = 0
  1849. IF Reply$ = "1" THEN SysMsgFlag = 247
  1850. IF Reply$ = "2" THEN SysMsgFlag = 239
  1851. IF Reply$ = "3" THEN SysMsgFlag = 223
  1852. IF Reply$ = "A" THEN SysMsgFlag = 199
  1853. IF Reply$ = "Q" THEN "Escape ClearFlags"
  1854. LONG IF SysMsgFlag
  1855. Temp1$ = Reply$
  1856. GOSUB "Echo LF"
  1857. Temp$ = "Are you sure you want to clear "
  1858. LONG IF SysMsgFlag <> 199
  1859. Temp$ = Temp$ +"SYSTEM"+Temp1$+".MSG flags? "
  1860. XELSE
  1861. Temp$ = Temp$ +"all three SYSTEM.MSG flags? "
  1862. END IF
  1863. GOSUB "Noline Echo"
  1864. GOSUB "Get Reply"
  1865. IF Reply$ <> CR$ THEN GOSUB "Echo LF"
  1866. IF Reply$ <> "Y" THEN "Escape ClearFlags"
  1867. GOSUB "Echo LF"
  1868. Temp$ = StandBy$
  1869. GOSUB "Newline Echo"
  1870. OPEN "R", 1, UserLog$, 136
  1871. ULength = LOF(1, 136)
  1872. Position = 0
  1873. WHILE (ULength - Position > 0)
  1874. RECORD #1, Position, 85
  1875. READ #1, Flag$;1
  1876. Flag$ = CHR$(ASC(Flag$) AND SysMsgFlag)
  1877. RECORD #1, Position, 85
  1878. WRITE #1, Flag$;1
  1879. Position = Position + 1
  1880. WEND
  1881. CLOSE #1
  1882. GOSUB "Echo LF"
  1883. END IF
  1884. END IF
  1885. "Escape ClearFlags"
  1886. RETURN
  1887. '
  1888. '    ------------- Set/Clear User Restriction Flags -------------
  1889. "RestrictFlags"
  1890. GOSUB "UserLog Password"
  1891. GOSUB "Echo LF"
  1892. LONG IF Password
  1893.   Temp$ = "This command sets or clears restriction flags for ALL UserLog entries."
  1894.   GOSUB "Newline Echo"
  1895.   GOSUB "Echo LF"
  1896.   Temp$ = "Set, Clear, Quit (S,C,Q)? "
  1897.   GOSUB "Noline Echo"
  1898.   GOSUB "Get Reply"
  1899.   IF Reply$ <> CR$ THEN GOSUB "Echo LF"
  1900.   GOSUB "Echo LF"
  1901.   LONG IF (Reply$ = "S") OR (Reply$ = "C")
  1902.     LONG IF Reply$ = "S"
  1903.       Flag = TRUE 
  1904.       Operate$ = " set "
  1905.     XELSE
  1906.       Flag = FALSE
  1907.       Operate$ = " clear "
  1908.     END IF
  1909.     Temp$ = "Flag to" + Operate$ + "(1-24)? "
  1910.     GOSUB "Noline Echo"
  1911.     GOSUB "Get A Line"
  1912.     GOSUB "Echo LF"
  1913.     FlagNo = VAL(Reply$)
  1914.     FlagNo = FlagNo - 1
  1915.     LONG IF (FlagNo => 0) AND (FlagNo =< 23)
  1916.       Temp$ = "Are you sure you want to" + Operate$ + "flag "
  1917.       Temp$ = Temp$ + Reply$ + " for ALL UserLog entries (Y,N)? "
  1918.       GOSUB "Echo LF"
  1919.       GOSUB "Noline Echo"
  1920.       GOSUB "Get Reply"
  1921.       IF Reply$ <> CR$ THEN GOSUB "Echo LF"
  1922.       GOSUB "Echo LF"
  1923.       LONG IF Reply$ = "Y"
  1924.         '       find out which of the three bytes to alter
  1925.         '       (bytes are in reverse order: 99, 98, 97)
  1926.         Offset = 99 - (FlagNo / 8)
  1927.         '       find out which bit to alter
  1928.         Temp1 = (FlagNo MOD 8)
  1929.         FlagNo = 2^Temp1
  1930.         '       AND with 255 to strip longint value
  1931.         IF NOT Flag THEN FlagNo = (NOT FlagNo) AND 255
  1932.         Temp$ = StandBy$
  1933.         GOSUB "Newline Echo"
  1934.         OPEN "R", 1, UserLog$, 136
  1935.         ULength = LOF(1, 136)
  1936.         Position = 0
  1937.         WHILE (ULength - Position) > 0
  1938.           RECORD #1, Position, Offset
  1939.           READ #1, Flag$;1
  1940.           LONG IF Flag
  1941.             Flag$ = CHR$(ASC(Flag$) OR FlagNo)
  1942.           XELSE:   REM   NOT Flag
  1943.             Flag$ = CHR$(ASC(Flag$) AND FlagNo)
  1944.           END IF
  1945.           RECORD #1, Position, Offset
  1946.           WRITE #1, Flag$;1
  1947.           Position = Position + 1
  1948.         WEND
  1949.         CLOSE #1
  1950.       END IF
  1951.     END IF
  1952.   END IF
  1953. END IF
  1954. RETURN
  1955. '
  1956. '    ------------- Analyze CallerLog -------------
  1957. '
  1958. SEGMENT
  1959. "Analyze CLog"
  1960. Temp$ = StandBy$
  1961. GOSUB "Newline Echo"
  1962. GOSUB "Echo LF"
  1963. Connections% = 0
  1964. Connect% = FALSE
  1965. B03% = 0
  1966. B12% = 0
  1967. B24% = 0
  1968. B96% = 0
  1969. B192% = 0
  1970. LocalKey% = 0
  1971. UL% = 0
  1972. Ux% = 0
  1973. DL% = 0
  1974. Dx% = 0
  1975. PubMsg% = 0
  1976. PriMsg% = 0
  1977. ExPgm% = 0
  1978. Exp% = 0
  1979. Lost% = 0
  1980. CLTimeTotal& = 0
  1981. FirstTime% = TRUE
  1982. WentToSleep% = 0
  1983. NoLog% = 0
  1984. TextRead% = 0
  1985. HostErr% = 0
  1986. TSYNCH% = 0
  1987. Off% = 0
  1988. NetMail% = 0
  1989. FOR Count = 1 TO 9
  1990. Caller$(Count) = ""
  1991. NEXT Count
  1992. OPEN "I", 1, Option$, 1
  1993. GOSUB "Echo LF"
  1994. Temp$ = Proceed$
  1995. GOSUB "Newline Echo"
  1996. WHILE (NOT EOF(1)) AND (NOT Interrupt)
  1997.   LINE INPUT#1, Temp$
  1998.   LONG IF (INSTR(1, Temp$, "Connection made at") > 0)
  1999.   Connections% = Connections% + 1
  2000.   GOSUB "Make Minutes"
  2001.   LogOnTime& = TotalMinutes&
  2002.   Temp% = INSTR(1, Temp$, " on ")
  2003.   ThisLog$ = RIGHT$(Temp$, LEN(Temp$) - Temp% + 1)
  2004.   LONG IF FirstTime%
  2005.     LogStartTime& = LogOnTime&
  2006.     FirstLog$ = RIGHT$(ThisLog$, LEN(ThisLog$) - 4)
  2007.     FirstLog$ = "First caller: " + FirstLog$
  2008.     FirstTime% = FALSE
  2009.   END IF
  2010.   Connect% = TRUE
  2011.   CheckedIn% = FALSE
  2012.   IF (INSTR(18, Temp$,  "300 baud") > 0) THEN B03% = B03% + 1
  2013.   IF (INSTR(18, Temp$, "1200 baud") > 0) THEN B12% = B12% + 1
  2014.   IF (INSTR(18, Temp$, "2400 baud") > 0) THEN B24% = B24% + 1
  2015.   IF (INSTR(18, Temp$, "9600 baud") > 0) THEN B96% = B96% + 1
  2016.   IF (INSTR(18, Temp$, "19200 baud") > 0) THEN B192% = B192% + 1
  2017.   IF (INSTR(18, Temp$, "local keyboard") > 0) THEN LocalKey% = LocalKey% + 1
  2018.   LONG IF NOT EOF(1) AND (NOT Interrupt)
  2019.     LINE INPUT#1, Temp$
  2020.     Temp1 = INSTR(1, Temp$, " from ")
  2021.     LONG IF Temp1 > 0
  2022.       CheckedIn% = TRUE
  2023.       LONG IF LEFT$(Caller$(9), Temp1) <> LEFT$(Temp$, Temp1):  REM Don't list repeat callers
  2024.         FOR Count = 1 TO 8
  2025.         Caller$(Count) = Caller$(Count + 1)
  2026.         NEXT Count
  2027.         Caller$(9) = Temp$ + ThisLog$
  2028.       END IF:                       REM Caller$(9) <> Temp$
  2029.     XELSE
  2030.       LONG IF (INSTR(1, Temp$, "TSYNCH received") > 0)
  2031.         TSYNCH% = TSYNCH% + 1
  2032.       END IF
  2033.     END IF:                       REM -- Temp1 > 0
  2034.   END IF:                       REM -- NOT EOF(1) AND (NOT Interrupt)
  2035.   LONG IF (NOT EOF(1)) AND (NOT Interrupt)
  2036.     LINE INPUT#1, Temp$
  2037.   END IF
  2038.   END IF:REM -- (INSTR(1, Temp$, "Connection made at") > 0)
  2039.   '
  2040.   LONG IF (INSTR(2, Temp$, "load") > 0)
  2041.     IF (INSTR(1, Temp$, "Uploaded") > 0) THEN UL% = UL% + 1
  2042.     LONG IF (INSTR(1, Temp$, "Upload cancelled") > 0)
  2043.       IF UL% > 0 THEN UL% = UL% - 1
  2044.       Ux% = Ux% + 1
  2045.     END IF
  2046.     IF (INSTR(1, Temp$, "Downloaded") > 0) THEN DL% = DL% + 1
  2047.     LONG IF (INSTR(1, Temp$, "Download cancelled") > 0)
  2048.       IF DL% > 0 THEN DL% = DL% - 1
  2049.       Dx% = Dx% + 1
  2050.     END IF
  2051.   END IF
  2052.   '
  2053.   LONG IF (INSTR(6, Temp$, " message ") > 0)
  2054.     IF (INSTR(1, Temp$, "Public message") > 0) THEN PubMsg% = PubMsg% + 1
  2055.     IF (INSTR(1, Temp$, "Private message") > 0) THEN PriMsg% = PriMsg% + 1
  2056.   END IF
  2057.   '
  2058.   IF (INSTR(1, Temp$, " text file <") > 0) THEN TextRead% = TextRead% +1
  2059.   IF (INSTR(1, Temp$, "Launching external ") > 0) THEN ExPgm% = ExPgm% + 1
  2060.   LONG IF (INSTR(1, Temp$, "Logged off") > 0)
  2061.     GOSUB "Make Minutes"
  2062.     LogOffTime& = TotalMinutes&
  2063.     IF Connect% = TRUE THEN CLTimeTotal& = CLTimeTotal& + LogOffTime& - LogOnTime&
  2064.     Connect% = FALSE
  2065.     IF CheckedIn% = FALSE THEN NoLog% = NoLog% + 1
  2066.     Off% = Off% + 1
  2067.   END IF
  2068.   LONG IF (INSTR(1, Temp$, "Time limit expired!") > 0)
  2069.     Exp% = Exp% + 1
  2070.   END IF
  2071.   LONG IF (INSTR(1, Temp$, "terminated due to inactivity") > 0)
  2072.     WentToSleep% = WentToSleep% + 1
  2073.   END IF
  2074.   LONG IF (INSTR(1, Temp$, "Modem lost carrier ") > 0)
  2075.     Lost% = Lost% + 1
  2076.   END IF
  2077.   LONG IF (INSTR(1, Temp$, "** Error <") > 0)
  2078.     HostErr% = HostErr% + 1
  2079.   END IF
  2080.   LONG IF (INSTR(1, Temp$, "network mail application") > 0)
  2081.     NetMail% = NetMail% + 1
  2082.   END IF
  2083.   '
  2084.   Check = Check + 1
  2085.   GOSUB "Check Modem"
  2086.   GOSUB "Check Interrupt"
  2087. WEND
  2088. CLOSE #1
  2089. IF Interrupt THEN "Exit Analysis"
  2090. NormOff% = Connections% - Exp% - Lost%
  2091. B! = B03% + B12% + B24% + B96%
  2092. B03P% = (100.0 * B03% \ B!) + 0.5
  2093. B12P% = (100.0 * B12% \ B!) + 0.5
  2094. B24P% = (100.0 * B24% \ B!) + 0.5
  2095. B96P% = (100.0 * B96% \ B!) + 0.5
  2096. B192P% = (100.0 * B192% \ B!) + 0.5
  2097. GOSUB "Echo LF"
  2098. Temp$ = "                          BBS Activity"
  2099. GOSUB "Newline Echo"
  2100. GOSUB "Echo LF"
  2101. Temp$ = FirstLog$
  2102. GOSUB "Newline Echo"
  2103. Temp = Connections%
  2104. GOSUB "Format Number"
  2105. Temp1$ = "Calls: " + Temp$
  2106. Temp =  CLTimeTotal& / Connections%
  2107. GOSUB "Format Number"
  2108. Temp$ = Temp1$ + "   Average: " + Temp$ + " minutes   "
  2109. GOSUB "Noline Echo"
  2110. Temp! = CLTimeTotal& \ 60
  2111. Temp = INT(Temp!)
  2112. GOSUB "Format Number"
  2113. Temp1$ = Temp$
  2114. Temp = (CLTimeTotal& MOD 60)
  2115. GOSUB "Format Number"
  2116. IF LEN(Temp$) = 1 THEN Temp$ = "0" + Temp$
  2117. Temp$ = "Use: " + Temp1$ + ":" + Temp$ + " ("
  2118. GOSUB "Noline Echo"
  2119. Temp! = 0.5 + (100.0 * (CLTimeTotal& \ (LogOffTime& - LogStartTime&)))
  2120. Temp = INT(Temp!)
  2121. GOSUB "Format Number"
  2122. Temp$ = Temp$ + "%)"
  2123. GOSUB "Newline Echo"
  2124. Temp = PubMsg%
  2125. GOSUB "Format Number"
  2126. Temp1$ = "Public messages: " + Temp$ + "   Private messages: "
  2127. Temp = PriMsg%
  2128. GOSUB "Format Number"
  2129. Temp1$ = Temp1$ + Temp$
  2130. Temp = UL%
  2131. GOSUB "Format Number"
  2132. Temp1$ = Temp1$ + "   Uploads: " + Temp$ + "   Downloads: "
  2133. Temp = DL%
  2134. GOSUB "Format Number"
  2135. Temp$ = Temp1$ + Temp$
  2136. GOSUB "Newline Echo"
  2137. Temp = B03%
  2138. GOSUB "Format Number"
  2139. Temp1$ = "300: " + Temp$ + " ("
  2140. Temp = B03P%
  2141. GOSUB "Format Number"
  2142. Temp1$ = Temp1$ + Temp$ + "%)  1200: "
  2143. Temp = B12%
  2144. GOSUB "Format Number"
  2145. Temp1$ = Temp1$ + Temp$ + " ("
  2146. Temp = B12P%
  2147. GOSUB "Format Number"
  2148. Temp1$ = Temp1$ + Temp$ + "%)  2400: "
  2149. Temp = B24%
  2150. GOSUB "Format Number"
  2151. Temp1$ = Temp1$ + Temp$ + " ("
  2152. Temp = B24P%
  2153. GOSUB "Format Number"
  2154. Temp1$ = Temp1$ + Temp$ + "%)  9600: "
  2155. Temp = B96%
  2156. GOSUB "Format Number"
  2157. Temp1$ = Temp1$ + Temp$ + " ("
  2158. Temp = B96P%
  2159. GOSUB "Format Number"
  2160. Temp1$ = Temp1$ + Temp$ + "%)  19200: "
  2161. Temp = B192%
  2162. GOSUB "Format Number"
  2163. Temp1$ = Temp1$ + Temp$ + " ("
  2164. Temp = B192P%
  2165. GOSUB "Format Number"
  2166. Temp$ = Temp1$ + Temp$ + "%)"
  2167. GOSUB "Newline Echo"
  2168. Temp1$ = "Local connects: "
  2169. Temp = LocalKey%
  2170. GOSUB "Format Number"
  2171. Temp1$ = Temp1$ + Temp$ + " "
  2172. Temp = Ux%
  2173. GOSUB "Format Number"
  2174. Temp1$ = Temp1$ + "  File transfers cancelled: " + Temp$ + " uploads and "
  2175. Temp = Dx%
  2176. GOSUB "Format Number"
  2177. Temp$ = Temp1$ + Temp$ + " downloads"
  2178. GOSUB "Newline Echo"
  2179. Temp = ExPgm%
  2180. GOSUB "Format Number"
  2181. Temp1$ = "External program launches: " + Temp$ + "   Text file reads: "
  2182. Temp = TextRead%
  2183. GOSUB "Format Number"
  2184. Temp$ = Temp1$ + Temp$
  2185. GOSUB "Newline Echo"
  2186. Temp = NormOff%
  2187. GOSUB "Format Number"
  2188. Temp1$ = "Exits: " + Temp$ + " normal, "
  2189. Temp = Exp%
  2190. GOSUB "Format Number"
  2191. Temp1$ = Temp1$ + Temp$ + " time expired, "
  2192. Temp = Lost%
  2193. GOSUB "Format Number"
  2194. Temp1$ = Temp1$ + Temp$ + " carrier lost and "
  2195. Temp = WentToSleep%
  2196. GOSUB "Format Number"
  2197. Temp$ = Temp1$ + Temp$ + " inactivity"
  2198. GOSUB "Newline Echo"
  2199. Temp = NoLog%
  2200. GOSUB "Format Number"
  2201. Temp$ = "Connect, no log: " + Temp$ + "   "
  2202. GOSUB "Noline Echo"
  2203. Temp = HostErr%
  2204. GOSUB "Format Number"
  2205. Temp$ = "Host errors: " + Temp$ + "   "
  2206. GOSUB "Newline Echo"
  2207. Temp = NetMail%
  2208. GOSUB "Format Number"
  2209. Temp1$ = "Netmail events: " + Temp$ + "   Crashmail events: "
  2210. Temp = TSYNCH%
  2211. GOSUB "Format Number"
  2212. Temp$ = Temp1$ + Temp$ + "   Disk space free: "
  2213. GOSUB "Noline Echo"
  2214. GOSUB "Free Space"
  2215. PRINT #Device,  USING "###,###";freeKBytes&;"K";EOL$;
  2216. IF NOT Local THEN PRINT USING "###,###";freeKBytes&;"K"
  2217. GOSUB "Echo LF"
  2218. Temp$ = "Most recent callers (old to new):"
  2219. GOSUB "Newline Echo"
  2220. GOSUB "Echo LF"
  2221. FOR Count = 1 TO 8
  2222. Temp$ = Caller$(Count)
  2223. LONG IF Count = 8 AND Temp$ = ""
  2224. Temp$ = "<No information available>"
  2225. END IF
  2226. IF Temp$ <> "" THEN GOSUB "Newline Echo"
  2227. NEXT Count
  2228. "Exit Analysis"
  2229. GOSUB "Hit Key to Continue"
  2230. SEGMENT RETURN
  2231. '
  2232. '    ------------- Calculate Minutes -------------
  2233. '      Enter with Temp$ from CallerLog, returns TotalMinutes& with minutes
  2234. '
  2235. "Make Minutes"
  2236. MDY$ = MID$(Temp$, (INSTR(28, Temp$, " on ") + 4), 8)
  2237. HMS$ = MID$(Temp$, (INSTR(19, Temp$, " at ") + 4), 8)
  2238. LONG IF INSTR(1, Temp$, "Logged off") > 0
  2239. MDY$ = MID$(Temp$, 15, 8)
  2240. HMS$ = MID$(Temp$, 27, 8)
  2241. END IF
  2242. '
  2243. '      HMS$ is a string in the form "HH:MM:SS"
  2244. '
  2245. Hour% = VAL(LEFT$(HMS$, 2))
  2246. Min% = VAL(MID$(HMS$, 4, 2))
  2247. Sec% = VAL(RIGHT$(HMS$, 2))
  2248. IF Sec% > 29 THEN Min% = Min% + 1
  2249. TotalMinutes& = Min% + (60 * Hour%)
  2250. GOSUB "Decode Date String"
  2251. GOSUB "Count the Days"
  2252. TotalMinutes& = TotalMinutes& + (24 * 60 * Day%)
  2253. '    -- Next line gets year of current system date
  2254. Temp% = VAL(RIGHT$(DATE$, 2))
  2255. Year% = Temp% - Year%
  2256. TotalMinutes& = TotalMinutes& + (365 * 24 * 60 * Year%)
  2257. RETURN
  2258. '
  2259. '    ------------- Decode Date String -------------
  2260. "Decode Date String"
  2261. '
  2262. '      MDY$ is a string in the form "MM/DD/YY"
  2263. '      Returns Month%, Day%, Year%
  2264. '
  2265. Month% = VAL(LEFT$(MDY$, 2))
  2266. Day%   = VAL(MID$(MDY$, 4, 2))
  2267. Year%  = VAL(RIGHT$(MDY$, 2))
  2268. RETURN
  2269. '
  2270. '    ------------- Count the Days -------------
  2271. "Count the Days"
  2272. '
  2273. '     Enter with Day%, Month% and Year%
  2274. '     Returns the day this is within the year in Day%
  2275. '
  2276. SELECT Month%
  2277. CASE  1:Temp% = 0
  2278. CASE  2:Temp% = 31
  2279. CASE  3:Temp% = 59
  2280. CASE  4:Temp% = 90
  2281. CASE  5:Temp% = 120
  2282. CASE  6:Temp% = 151
  2283. CASE  7:Temp% = 181
  2284. CASE  8:Temp% = 212
  2285. CASE  9:Temp% = 243
  2286. CASE 10:Temp% = 273
  2287. CASE 11:Temp% = 304
  2288. CASE 12:Temp% = 334
  2289. END SELECT
  2290. Day% = Day% + Temp%
  2291. IF (Year% MOD 4) = 0 THEN IF Month% > 2 THEN Day% = Day% + 1
  2292. RETURN
  2293. '
  2294. '    ------------- Free Space -------------
  2295. "Free Space"
  2296. '                             Get volume information
  2297. '
  2298. hParamBlkPtr& = VARPTR(paramBlock$)
  2299. ioCompletion& = 0
  2300. POKE LONG hParamBlkPtr& + 12, ioCompletion&
  2301. ioNamePtr& = VARPTR(VolName$)
  2302. POKE LONG hParamBlkPtr& + 18, ioNamePtr&
  2303. '
  2304. ioVRefNum% = 0    :  '        0 is default volume
  2305. POKE WORD hParamBlkPtr& + 22, ioVRefNum%
  2306. ioVolIndex% = 0    :  '        0 is default volume
  2307. POKE WORD hParamBlkPtr& + 28, ioVolIndex%
  2308. '
  2309. GET VOLUME INFO paramBlock$
  2310. ioVAlBlkSiz& = PEEK LONG(hParamBlkPtr& + 48)
  2311. ioVFrBlk&    = PEEK WORD(hParamBlkPtr& + 62)
  2312. IF ioVFrBlk& < 0 THEN ioVFrBlk& = ioVFrBlk& + 65535
  2313. freeKBytes& = (ioVAlBlkSiz& * ioVFrBlk&) / 1024
  2314. RETURN
  2315. '
  2316. '    ------------- Last Callers -------------
  2317. "Last Callers"
  2318. FOR Count = 1 TO 9
  2319. Caller$(Count) = ""
  2320. NEXT Count
  2321. OPEN "I", 1, Option$, 1
  2322. WHILE (NOT EOF(1)) AND (NOT Interrupt)
  2323. LINE INPUT#1, Temp$
  2324. Temp1 = INSTR(1, Temp$, " from ")
  2325. LONG IF Temp1
  2326. LONG IF LEFT$(Caller$(9), Temp1) <> LEFT$(Temp$, Temp1):  REM Don't list repeat callers
  2327. Caller$(9) = Temp$
  2328. FOR Count = 1 TO 8
  2329. Caller$(Count) = Caller$(Count + 1)
  2330. NEXT Count
  2331. END IF:                       REM Caller$(9) <> Temp$
  2332. END IF:                       REM Temp1 > 0
  2333. GOSUB "Check Modem"
  2334. GOSUB "Check Interrupt"
  2335. WEND
  2336. CLOSE #1
  2337. LONG IF NOT Interrupt
  2338. GOSUB "Echo LF"
  2339. Temp$ = "Most recent callers (old to new):"
  2340. GOSUB "Newline Echo"
  2341. GOSUB "Echo LF"
  2342. FOR Count = 1 TO 8
  2343. Temp$ = Caller$(Count)
  2344. LONG IF Count = 8 AND Temp$ = ""
  2345. Temp$ = "<No information available>"
  2346. END IF
  2347. IF Temp$ <> "" THEN GOSUB "Newline Echo"
  2348. NEXT Count
  2349. END IF:                       REM NOT Interrupt
  2350. GOSUB "Hit Key to Continue"
  2351. RETURN
  2352. '
  2353. '    ------------- Check Modem -------------
  2354. "Check Modem"
  2355. GOSUB "Turn Menus On"
  2356. LONG IF NOT Local
  2357. LONG IF (PEEK(Modem) AND Hang) <> 0
  2358. GOSUB "Flush Keystrokes"
  2359. PRINT #Port, "ATS0=0"
  2360. DELAY 500
  2361. GOTO "Exit"
  2362. END IF
  2363. END IF
  2364. RETURN
  2365. '
  2366. '    ------------- Get Reply -------------
  2367. '
  2368. '    This routine handles caller input based on UserLog info.
  2369. '
  2370. "Get Reply"
  2371. LONG IF HotMenus
  2372. GOSUB "Get A Key"
  2373. Reply$ = UCASE$(Hit$)
  2374. XELSE
  2375. GOSUB "Get A Line"
  2376. END IF
  2377. RETURN
  2378. '
  2379. '    ------------- Get A Line From User -------------
  2380. '
  2381. '    This routine translates user input to uppercase, handles
  2382. '    backspaces and forms lines.
  2383. '
  2384. "Get A Line"
  2385. LineCounter% = 1
  2386. LONG IF NOT Local
  2387. Reply$ = ""
  2388. Hit$ = ""
  2389. WHILE Hit$ <> CR$ AND LineCounter% < 80
  2390. GOSUB "Get A Key"
  2391. Hit$ = UCASE$(Hit$)
  2392. LineCounter% = LineCounter% + 1
  2393. IF Hit$ => " " THEN Reply$ = Reply$ + Hit$
  2394. LONG IF Hit$ = CHR$(8)
  2395. Reply$ = LEFT$(Reply$, LEN(Reply$) - 1)
  2396. LineCounter% = LineCounter% + 1
  2397. END IF
  2398. WEND
  2399. GOSUB "Echo LF"
  2400. XELSE
  2401. LINE INPUT "";Reply$
  2402. Reply$ = UCASE$(Reply$)
  2403. END IF
  2404. RETURN
  2405. '
  2406. '    ------------- Get A Key Of User Input -------------
  2407. '
  2408. '    This routine gets a keystroke from the local or remote keyboard
  2409. '    and times out to an exit if there's no user input for the value
  2410. '    set in the Config file. As long as we're looking, we also check
  2411. '    Carrier Detect for remote callers and exit if it's not there.
  2412. '
  2413. "Get A Key"
  2414. Elapsed = 0
  2415. TimeFlag = FALSE
  2416. WHILE Elapsed < Inactivity
  2417. ':     ChatFlag is set true by Chat menu item
  2418. IF ChatFlag THEN GOSUB "Chat"
  2419. GOSUB "Check Modem"
  2420. Hit$ = INKEY$
  2421. IF (NOT Local) AND (LEN(Hit$) = 0) THEN READ #Port, Hit$;0
  2422. LONG IF LEN(Hit$)
  2423. '      next line filters out +++ combinations to modem (maybe?)
  2424. IF Hit$ = "+" THEN IF NOT Local THEN Hit$ = CHR$(19) + "+" + CHR$(17)
  2425. IF NOT NoShow THEN Temp$ = Hit$:GOSUB "Noline Echo"
  2426. NoShow = FALSE
  2427. RETURN
  2428. END IF
  2429. "Timing Loop"
  2430. LONG IF NOT TimeFlag
  2431. Temp$ = TIME$
  2432. Started = FN MakeTime
  2433. TimeFlag = TRUE
  2434. END IF
  2435. GOSUB "Turn Menus On"
  2436. Temp$ = TIME$
  2437. Temp = FN MakeTime
  2438. Elapsed = Temp - Started
  2439. '             Mext line adjusts for hour boundary
  2440. LONG IF Elapsed < 0
  2441. Started = Started - 3600
  2442. Elapsed = Temp - Started
  2443. END IF
  2444. WEND
  2445. '    The only way to get to the next line is if Elapsed > Inactivity
  2446. GOTO "Exit"
  2447. '
  2448. '    ------------- Check for Interrupt -------------
  2449. "Check Interrupt"
  2450. Interrupt = FALSE
  2451. IF Local THEN Break$ = INKEY$ ELSE READ #Port, Break$;0
  2452. LONG IF LEN(Break$)
  2453. Break$ = UCASE$(Break$)
  2454. LONG IF (Break$ = "S") OR (Break$ = CHR$(19))
  2455. NoShow = TRUE
  2456. GOSUB "Get A Key"
  2457. Break$ = ""
  2458. Hit$ = ""
  2459. END IF
  2460. IF (Break$ = "C") OR (Break$ = CHR$(3)) THEN Interrupt = TRUE
  2461. END IF
  2462. RETURN
  2463. '
  2464. '    ------------- Newline Echo -------------
  2465. "Newline Echo"
  2466. LF = TRUE
  2467. GOSUB "Echo"
  2468. RETURN
  2469. '
  2470. '    ------------- NoLine Echo -------------
  2471. "Noline Echo"
  2472. LF = FALSE
  2473. GOSUB "Echo"
  2474. RETURN
  2475. '
  2476. '    ------------- Echo  -------------
  2477. "Echo"
  2478. PRINT #Device, Temp$;
  2479. IF LF THEN PRINT #Device, EOL$;
  2480. LONG IF NOT Local
  2481. PRINT Temp$;
  2482. IF LF THEN PRINT
  2483. END IF
  2484. RETURN
  2485. '
  2486. '    ------------- Echo LF -------------
  2487. "Echo LF"
  2488. PRINT #Device, EOL$;
  2489. IF NOT Local THEN PRINT
  2490. RETURN
  2491. '
  2492. '    ------------- Read A Menu -------------
  2493. '    Displays a menu and returns with valid command # in Command
  2494. "Read A Menu"
  2495. Reply = FALSE
  2496. Execute = FALSE
  2497. OPEN "I", 1, MenuFile$
  2498. FOR Count% = 1 TO 3
  2499. READ #1, Temp$;61
  2500. TitleText$(Count%) = FN MakeStr$(Temp$)
  2501. NEXT Count%
  2502. IF UCASE$(TitleText$(1)) = "EXECUTE" THEN Execute = TRUE
  2503. READ #1, Temp$;1
  2504. CmdTotal = ASC(Temp$)
  2505. FOR CmdCount = 1 TO CmdTotal
  2506. READ #1, Temp$;1
  2507. CmdType(CmdCount) = ASC(Temp$)
  2508. READ #1, Temp$;61
  2509. MenuText$(CmdCount) = FN MakeStr$(Temp$)
  2510. READ #1, CmdKey$(CmdCount);1
  2511. IF (CmdType(CmdCount) = 0) THEN CmdKey$(CmdCount) = CHR$(255)
  2512. READ #1, Temp$;41
  2513. CmdOpt$(CmdCount) = FN MakeStr$(Temp$)
  2514. READ #1, Temp$;1
  2515. CmdMod(CmdCount) = ASC(Temp$)
  2516. READ #1, Temp$;1
  2517. CmdClr(CmdCount) = ASC(Temp$)
  2518. GOSUB "Check Clearance"
  2519. LONG IF (NOT Clear)
  2520. MenuText$(CmdCount) = ""
  2521. CmdKey$(CmdCount) = CHR$(255)
  2522. END IF
  2523. READ #1, Temp$;1,Temp$;3
  2524. GOSUB "Decode Restriction"
  2525. Restrict&(CmdCount) = Temp&
  2526. READ #1, Temp$;1
  2527. CmdRMod(CmdCount) = ASC(Temp$)
  2528. IF Clear THEN GOSUB "Check Restriction"
  2529. LONG IF (NOT Clear)
  2530. MenuText$(CmdCount) = ""
  2531. CmdKey$(CmdCount) = CHR$(255)
  2532. END IF
  2533. NEXT CmdCount
  2534. CLOSE #1
  2535. IF Execute THEN "Execute Shortcut"
  2536. "Show The Menu"
  2537. '    Next section displays menu contents
  2538. FOR Count% = 1 TO 3
  2539. Temp$ = TitleText$(Count%)
  2540. LONG IF NOT HotMenus
  2541. GOSUB "Newline Echo"
  2542. XELSE
  2543. GOSUB "Display Menu"
  2544. END IF
  2545. IF Reply THEN Count% = 3
  2546. NEXT Count%
  2547. IF Reply THEN "Leave Read a Menu"
  2548. FOR CmdCount = 1 TO CmdTotal
  2549. Temp$ = MenuText$(CmdCount)
  2550. LONG IF Temp$ > ""
  2551. LONG IF NOT HotMenus
  2552. GOSUB "Newline Echo"
  2553. XELSE
  2554. GOSUB "Display Menu"
  2555. END IF
  2556. END IF
  2557. IF Reply THEN CmdCount = CmdTotal
  2558. NEXT CmdCount
  2559. IF Reply THEN "Leave Read a Menu"
  2560. GOSUB "Echo LF"
  2561. LONG IF ShowTime
  2562. Now$ = TIME$
  2563. Hour$ = LEFT$(Now$, 2)
  2564. Minute$ = MID$(Now$, 4, 2)
  2565. Now = (60 * VAL(Hour$)) + VAL(Minute$)
  2566. Elapsed = Now - LogOnMinute
  2567. '       Next line makes up for possible midnight boundary
  2568. IF Elapsed < (-12 * 60) THEN Elapsed = Elapsed + (24 * 60)
  2569. Remaining = ArchTime - Elapsed
  2570. LONG IF Remaining < 0
  2571. GOSUB "Echo LF"
  2572. Temp$ = "Time limit expired!"
  2573. GOSUB "Newline Echo"
  2574. GOSUB "Echo LF"
  2575. GOTO "Exit"
  2576. END IF
  2577. Temp = Remaining
  2578. Place% = 0
  2579. GOSUB "Format Number"
  2580. IF Temp = 0 THEN Temp$ = "<1"
  2581. Temp$ = "(" + Temp$ + " minutes left) "
  2582. GOSUB "Noline Echo"
  2583. END IF
  2584. LONG IF ShowChoice
  2585. Temp$ = "Command ("
  2586. GOSUB "Noline Echo"
  2587. Temp$ = ""
  2588. FOR Count% = 1 TO CmdTotal
  2589. LONG IF CmdKey$(Count%) <> CHR$(255)
  2590. Temp$ = Temp$ + CmdKey$(Count%) + ","
  2591. END IF
  2592. NEXT Count%
  2593. IF RIGHT$(Temp$, 1) = "," THEN Temp$ = LEFT$(Temp$,  LEN(Temp$) -1)
  2594. Temp$ = Temp$ + ") ? "
  2595. GOSUB "Noline Echo"
  2596. XELSE
  2597. Temp$ = "Command? "
  2598. GOSUB "Noline Echo"
  2599. END IF
  2600. "Menu Loop"
  2601. IF HotMenus THEN NoShow = TRUE
  2602. GOSUB "Get Reply"
  2603. LONG IF HotMenus AND (Reply$ = CR$)
  2604. GOSUB "Echo LF"
  2605. GOTO "Show The Menu"
  2606. END IF
  2607. IF NOT HotMenus THEN Reply$ = RIGHT$(Reply$, 1)
  2608. "Execute Shortcut"
  2609. IF Execute = TRUE THEN Reply$ = "*"
  2610. FOR CmdCount = 1 TO CmdTotal
  2611. LONG IF Reply$ = CmdKey$(CmdCount)
  2612. IF CmdType(CmdCount) > 0 THEN GOSUB "Check Clearance"
  2613. LONG IF Clear
  2614. LONG IF (HotMenus AND Execute = FALSE)
  2615. Temp$ = Reply$
  2616. GOSUB "Newline Echo"
  2617. END IF
  2618. Command = CmdType(CmdCount)
  2619. Option$ = CmdOpt$(CmdCount)
  2620. "Leave Read a Menu"
  2621. RETURN
  2622. END IF
  2623. END IF
  2624. NEXT CmdCount
  2625. IF NOT HotMenus THEN "Show The Menu" ELSE "Menu Loop"
  2626. '
  2627. '    ------------- Display Menu -------------
  2628. "Display Menu"
  2629. Temp% = LEN(Temp$)
  2630. FOR NewCount% = 1 TO Temp%
  2631. Char$ = MID$(Temp$, NewCount%, 1)
  2632. PRINT #Device, Char$;
  2633. IF NOT Local THEN PRINT Char$;
  2634. IF Local THEN Reply$ = INKEY$ ELSE READ #Port, Reply$;0
  2635. LONG IF LEN(Reply$)
  2636. Reply$ = UCASE$(Reply$)
  2637. FOR CommandCount = 1 TO CmdTotal
  2638. LONG IF Reply$ = CmdKey$(CommandCount)
  2639. LONG IF CmdType(CommandCount) > 0
  2640. GOSUB "Check Clearance"
  2641. IF Clear THEN GOSUB "Check Restriction"
  2642. END IF
  2643. LONG IF Clear
  2644. Temp$ = Reply$
  2645. GOSUB "Newline Echo"
  2646. Command = CmdType(CommandCount)
  2647. Option$ = CmdOpt$(CommandCount)
  2648. NewCount% = Temp% + 1
  2649. Reply = TRUE
  2650. CommandCount = CmdTotal
  2651. NewCount% = Temp%
  2652. END IF:    REM          >> IF Clearance OK        <<
  2653. END IF:    REM          >> IF Reply$ = CmdKey$()  <<
  2654. GOSUB "Check Modem"
  2655. NEXT CommandCount
  2656. END IF
  2657. NEXT NewCount%
  2658. GOSUB "Echo LF"
  2659. RETURN
  2660. '
  2661. '    ------------- Check Clearance -------------
  2662. "Check Clearance"
  2663. Clear = FALSE
  2664. LONG IF CmdMod(CmdCount) = 0
  2665. IF ArchClearance => CmdClr(CmdCount) THEN Clear = TRUE
  2666. XELSE
  2667. LONG IF CmdMod(CmdCount) = 1
  2668. IF ArchClearance =< CmdClr(CmdCount) THEN Clear = TRUE
  2669. XELSE
  2670. IF ArchClearance = CmdClr(CmdCount) THEN Clear = TRUE
  2671. END IF
  2672. END IF
  2673. RETURN
  2674. '
  2675. '    ------------- Check Restriction -------------
  2676. "Check Restriction"
  2677. Clear = FALSE
  2678. '            If CmdRMod(CmdCount) = 0 then user's restriction flags must exactly
  2679. '            match menu's
  2680. LONG IF CmdRMod(CmdCount) = 0
  2681. Temp& = Restrict&(CmdCount) AND Restriction&
  2682. IF Temp& = Restrict&(CmdCount) THEN Clear = TRUE
  2683. '
  2684. '            If CmdRMod(CmdCount) <> 0 then user's restriction flags must not
  2685. '            match those set in menu command
  2686. '
  2687. XELSE
  2688. Temp& = Restrict&(CmdCount) AND Restriction&
  2689. IF Temp& = 0 THEN Clear = TRUE
  2690. END IF
  2691. RETURN
  2692. '
  2693. '    ------------- Get Caller's Speed & UserLog Offset -------------
  2694. "Host Status"
  2695. LONG IF MOUSE(3) <> 0
  2696. ArchieLocal = TRUE
  2697. MENU 1, 4, 0, "Hang up without update"
  2698. GOSUB "No Launchfile"
  2699. XELSE
  2700. ArchieLocal = FALSE
  2701. END IF
  2702. ON ERROR GOSUB "Switch Launchfile"
  2703. Temp$ = Host$
  2704. GOSUB "Path Finder"
  2705. "Try Again"
  2706. Temp$ = HostPath$ + LaunchFile$
  2707. OPEN "I", 1, Temp$, 69
  2708. ON ERROR GOSUB "No Launchfile"
  2709. READ #1, Temp$;4,Baud$;1,Temp$;3,LogOn$;6,Offset$;4
  2710. READ #1, Temp$;4,Time$;1,Clearance$;1,Temp$;3,ReturnMenu$;41
  2711. READ #1, Temp$;11,Restriction$;3
  2712. CLOSE #1
  2713. "Host Status Resume"
  2714. Baud = ASC(Baud$)
  2715. SELECT Baud
  2716. CASE 0:Baud = 300:Baud$ =   "(300)"
  2717. CASE 1:Baud = 9600:Baud$ = "(9600)"
  2718. CASE 2:Baud = 1200:Baud$ = "(1200)"
  2719. CASE 3:Baud = 2400:Baud$ = "(2400)"
  2720. CASE 4:Baud = 2400:Baud$ = "(Local)":Local = TRUE
  2721. CASE 5:Baud =19200:Baud$ = "(19200)"
  2722. END SELECT
  2723. IF Baud < 300 THEN IF Baud > 0 THEN "Exit"
  2724. '        We ignore bytes 1-3 and 6 of LogOn$ because we don't need 'em
  2725. LogOnHour   = ASC(MID$(LogOn$, 4, 1))
  2726. LogOnMinute = ASC(MID$(LogOn$, 5, 1))
  2727. LogOnMinute = LogOnMinute + (60 * LogOnHour)
  2728. ArchTime = ASC(Time$)
  2729. ArchClearance = ASC(Clearance$)
  2730. ReturnMenu$ = FN MakeStr$(ReturnMenu$)
  2731. Temp% = INSTR(1, ReturnMenu$, "{")
  2732. LONG IF (Temp% > 0) AND (INSTR(Temp%, ReturnMenu$, "}") > 0)
  2733. ArchieMenu$ = RIGHT$(ReturnMenu$, LEN(ReturnMenu$) - (Temp% - 1))
  2734. XELSE
  2735. Temp% = INSTR(1, ReturnMenu$, ";")
  2736. LONG IF (Temp% > 0)
  2737. ArchieMenu$ = RIGHT$(ReturnMenu$, (LEN(ReturnMenu$) - Temp%))
  2738. TempLen = LEN(ArchieMenu$)
  2739. DO
  2740. Temp% = INSTR(1, ArchieMenu$, ";")
  2741. MID$(ArchieMenu$, Temp%, 1) = ":"
  2742. UNTIL Temp% = 0
  2743. END IF
  2744. END IF
  2745. Temp$ = Restriction$
  2746. GOSUB "Decode Restriction"
  2747. Restriction& = Temp&
  2748. RETURN
  2749. '
  2750. '    ------------- Decode Restriction -------------
  2751. "Decode Restriction"
  2752. '      Decodes three-byte restriction flag.
  2753. '      Enter with Temp$, returns Temp&.
  2754. '      Bytes are in MSB -> LSB order.
  2755. Temp& = 0
  2756. FOR Count% = 2 TO 0 STEP -1
  2757. Temp& = ((ASC(MID$(Temp$, (3 - Count%), 1))) * 256^Count%) + Temp&
  2758. NEXT Count%
  2759. RETURN
  2760. '
  2761. '    ------------- Switch Launchfile -------------
  2762. "Switch Launchfile"
  2763. ERROR = 0
  2764. ON ERROR GOSUB "No Launchfile"
  2765. LaunchFile$ = "LaunchSS"
  2766. RETURN "Try Again"
  2767. '
  2768. '    ------------- No Launchfile -------------
  2769. "No Launchfile"
  2770. ERROR = 0
  2771. ON ERROR GOSUB "No Archie Run"
  2772. LONG IF MOUSE(3) = 0
  2773. Temp$ = HostPath$ + "Archie Run"
  2774. OPEN "I", 1, Temp$
  2775. CLOSE #1
  2776. END IF
  2777. Baud$ = CHR$(4)
  2778. Temp$ = TIME$
  2779. Hour$   = CHR$(VAL(MID$(Temp$, 1, 2)))
  2780. Minute$ = CHR$(VAL(MID$(Temp$, 4, 2)))
  2781. LogOn$ = STRING$(3, CHR$(0)) + Hour$ + Minute$
  2782. Offset$ = STRING$(4, CHR$(0))
  2783. OPEN "I", 1, UserLog$, 1
  2784. GOSUB "Read UserLog Entry"
  2785. CLOSE #1
  2786. ReturnMenu$ = CHR$(10) + "Main Menu"
  2787. RETURN "Host Status Resume"
  2788. "No Archie Run"
  2789. ERROR = 0
  2790. BEEP
  2791. PRINT
  2792. PRINT "Archie must be run as a Command 50/51 application from Host. It"
  2793. PRINT "cannot run as an application from the DeskTop. Check the RR Host"
  2794. PRINT "and Archie documentation for more information."
  2795. PRINT
  2796. PRINT Exit$;
  2797. DO
  2798. UNTIL LEN(INKEY$)
  2799. GOSUB "Desktop"
  2800. '
  2801. '    ------------- Who's On The BBS Now? -------------
  2802. '
  2803. '    This checks the Userlog offset contained in LaunchRRH, looks up the
  2804. '    user in the UserLog, puts User's first & last name in caps/lower case
  2805. '    and sets LineFeed variable to TRUE if caller needs linefeeds.
  2806. '
  2807. SEGMENT
  2808. "User Status"
  2809. GOSUB "Decode Offset"
  2810. OPEN "I", 1, UserLog$, 1
  2811. RECORD #1, Offset&
  2812. GOSUB "Read UserLog Entry"
  2813. CLOSE #1
  2814. ArchCaller$ = Caller$
  2815. Flag = ASC(Flag$)
  2816. IF (NOT Local) AND (Flag AND 1) THEN LineFeed = TRUE ELSE LineFeed = FALSE
  2817. IF Flag AND   2 THEN HowToClear = TRUE
  2818. IF Flag AND   4 THEN HotMenus = FALSE ELSE HotMenus = TRUE
  2819. IF Flag AND 128 THEN NoClear = TRUE
  2820. Year%  = ASC(MID$(LastCall$, 1, 1))
  2821. Month% = ASC(MID$(LastCall$, 2, 1))
  2822. Day%   = ASC(MID$(LastCall$, 3, 1))
  2823. GOSUB "Count the Days"
  2824. ArchLastCall& = Day% + (Year% * 365.25)
  2825. MyClearance = Clearance
  2826. SEGMENT RETURN
  2827. '
  2828. '    ------------- Separate Path & Filename -------------
  2829. "Path Finder"
  2830. Temp = LEN (Temp$)
  2831. FOR J = Temp TO 1 STEP -1
  2832. Colon = INSTR(J, Temp$, ":")
  2833. IF Colon THEN J = 0
  2834. NEXT J
  2835. FName$ = RIGHT$(Temp$, Temp - Colon)
  2836. Temp$ = LEFT$(Temp$, Colon)
  2837. RETURN
  2838. '
  2839. '    ------------- Hit Key to Continue -------------
  2840. "Hit Key to Continue"
  2841. GOSUB "Echo LF"
  2842. GOSUB "Flush Keystrokes"
  2843. Temp$ = Continue$
  2844. GOSUB "Noline Echo"
  2845. NoShow = TRUE
  2846. GOSUB "Get A Key"
  2847. RETURN
  2848. '
  2849. '    ------------- Flush Keystrokes -------------
  2850. "Flush Keystrokes"
  2851. DO
  2852. IF NOT Local THEN READ #Port, Hit$;0 ELSE Hit$ = INKEY$
  2853. UNTIL LEN(Hit$) < 1
  2854. RETURN
  2855. '
  2856. '    ------------- Decode Offset -------------
  2857. "Decode Offset"
  2858. Offset& = 0
  2859. FOR Count% = 1 TO 4
  2860. Temp$ = MID$(Offset$, Count%, 1)
  2861. Temp& = ASC(Temp$)
  2862. Offset& = (Temp& * 256^(4 - Count%)) + Offset&
  2863. NEXT Count%
  2864. RETURN
  2865. '
  2866. '    ------------- Change ALL CAPS to Caps/Lower Case -------------
  2867. "Initial Caps"
  2868. L = LEN(Temp$)
  2869. FOR Count% = 2 TO L
  2870. A$ = MID$(Temp$, Count%, 1)
  2871. A = ASC(A$)
  2872. IF A > 64 THEN A = A + 32
  2873. A$ = CHR$(A)
  2874. MID$(Temp$, Count%, 1) = A$
  2875. NEXT Count%
  2876. RETURN
  2877. '
  2878. '    ------------- String Maker -------------
  2879. "String Maker"
  2880. Count$ = STR$(Count%)
  2881. L = LEN(Count$)
  2882. Count$ = RIGHT$(Count$, L-1)
  2883. RETURN
  2884. '
  2885. '     ------------- Read UserLog Entry -------------
  2886. "Read UserLog Entry"
  2887. READ #1, Name1$;16, Name2$;16, From$;31, PW$;9, NoCalls$;2, LastCall$;6
  2888. READ #1, Time$;1, Clearance$;1, Temp1$;3, Flag$;1
  2889. READ #1, UL$;2, DL$;2, Priv$;2, Pub$;2, Junk$;3, Restriction$;3, Junk$;36
  2890. Temp$ = FN MakeStr$(Name1$)
  2891. GOSUB "Initial Caps"
  2892. Name1$ = Temp$
  2893. Temp$ = FN MakeStr$(Name2$)
  2894. GOSUB "Initial Caps"
  2895. Caller$ = Name1$ + " " + Temp$
  2896. Temp$ = NoCalls$
  2897. NoCalls = FN Short
  2898. Time = ASC(Time$)
  2899. Clearance = ASC(Clearance$)
  2900. Temp$ = UL$
  2901. UL = FN Short
  2902. Temp$ = DL$
  2903. DL = FN Short
  2904. Temp$ = Priv$
  2905. Priv = FN Short
  2906. Temp$ = Pub$
  2907. Pub = FN Short
  2908. RETURN
  2909. '
  2910. '    ------------- Archie Information -------------
  2911. "Archie Info"
  2912. GOSUB "Echo LF"
  2913. GOSUB "Echo LF"
  2914. Temp$ = "Archie '89 "+Version$+" (" + When$ + ")"
  2915. GOSUB "Newline Echo"
  2916. GOSUB "Echo LF"
  2917. Temp$ = "Written by Pete Johnson"
  2918. GOSUB "Newline Echo"
  2919. Temp$ = "Dedicated to Abbey, the original Glassell Park Staff Dog"
  2920. GOSUB "Newline Echo"
  2921. GOSUB "Echo LF"
  2922. Temp$ = "Programmed in ZBasic. Portions copyright 1985-89 Zedcor, Inc."
  2923. GOSUB "Newline Echo"
  2924. GOSUB "Echo LF"
  2925. Temp$ = CHR$(34) + "Computers are useless. They can only give you answers." + CHR$(34)
  2926. GOSUB "Newline Echo"
  2927. Temp$ = "          -- Pablo Picasso"
  2928. GOSUB "Newline Echo"
  2929. GOSUB "Echo LF"
  2930. Temp$ = "Thanks for visiting, " + ArchCaller$ + "."
  2931. GOSUB "Newline Echo"
  2932. GOSUB "Echo LF"
  2933. Temp$ = Continue$
  2934. GOSUB "Noline Echo"
  2935. GOSUB "Get A Key"
  2936. IF Hit$ <> CR$ THEN GOSUB "Echo LF"
  2937. RETURN
  2938. '
  2939. '    ------------- UserLog Password -------------
  2940. "UserLog Password"
  2941. LONG IF Option$ <> ""
  2942. Password = FALSE
  2943. GOSUB "Echo LF"
  2944. Temp$ = "Please enter special UserLog viewing password: "
  2945. GOSUB "Noline Echo"
  2946. GOSUB "Get A Line"
  2947. IF UCASE$(Reply$) = UCASE$(Option$) THEN Password = TRUE
  2948. LONG IF (NOT Password)
  2949. Temp$ = "Sorry, but that's not the right password."
  2950. GOSUB "Newline Echo"
  2951. GOSUB "Echo LF"
  2952. END IF
  2953. XELSE
  2954. Password = TRUE
  2955. END IF
  2956. RETURN
  2957. '
  2958. '    ------------- Get Archie Info -------------
  2959. SEGMENT
  2960. "Get Archie Info"
  2961. ON ERROR GOSUB "No Info"
  2962. '    Find out what Archie is called...
  2963. CurApName = &H910
  2964. CurApName$ = ""
  2965. FOR Count% = 1 TO PEEK(CurApName)
  2966. CurApName$ = CurApName$ + CHR$(PEEK(CurApName + Count%))
  2967. NEXT Count%
  2968. '
  2969. '    Open Archie resource file
  2970. Refnum = FN OPENRESFILE(CurApName$)
  2971. GOSUB "Resource Error?"
  2972. FOR Resource% = 130 TO 138
  2973. SHndl& = FN GETNAMEDRESOURCE(CVI("STR "), ResName$(Resource%))
  2974. LONG IF SHndl& = 0
  2975. PRINT "No string available for STR ";Resource%;" (";ResName$(Resource%);")"
  2976. XELSE
  2977. SHndl& = FN GETSTRING(Resource%)
  2978. Archie$(Resource%) = FN ReturnString$(SHndl&)
  2979. END IF
  2980. NEXT Resource%
  2981. ArchieLogo& = FN GETPICTURE(500)
  2982. Host$ = Archie$(130)
  2983. OPEN "I", 1, Host$
  2984. CLOSE #1
  2985. IF ArchieMenu$ = "" THEN ArchieMenu$ = Archie$(131)
  2986. OPEN "I", 1, ArchieMenu$
  2987. CLOSE #1
  2988. DLValue = VAL(Archie$(132))
  2989. MsgValue! = VAL(Archie$(133))
  2990. NewCall = VAL(Archie$(134))
  2991. Privilege = VAL(Archie$(135))
  2992. CheckDL = VAL(Archie$(136))
  2993. CheckDL$ = Archie$(136)
  2994. CheckUL = VAL(Archie$(137))
  2995. CheckUL$ = Archie$(137)
  2996. CheckMsg = VAL(Archie$(138))
  2997. CheckMsg$ = Archie$(138)
  2998. Temp$ = Host$
  2999. GOSUB "Path Finder"
  3000. HostPath$ = Temp$
  3001. HostName$ = RIGHT$(Host$, (LEN(Host$) - LEN(HostPath$)))
  3002. Temp$ = Archie$
  3003. GOSUB "Path Finder"
  3004. ArchiePath$ = Temp$
  3005. Temp$ = HostPath$ + "Config"
  3006. ON ERROR GOSUB "No Config"
  3007. OPEN "I", 1, Temp$
  3008. READ #1, Temp$;1
  3009. IF ASC(Temp$) = 0 THEN PrintCallerLog = TRUE ELSE PrintCallerLog = FALSE
  3010. IF ASC(Temp$) = 1 THEN CallerLog = TRUE ELSE CallerLog = FALSE
  3011. IF ASC(Temp$) = 2 THEN CallerLog = TRUE:PrintCallerLog = TRUE
  3012. READ #1, Temp$;11
  3013. READ #1, Temp$;1
  3014. Inactivity = 60 * ASC(Temp$)
  3015. READ #1, Temp$;6
  3016. READ #1, Temp$;1
  3017. IF ASC(Temp$) = 1 THEN Port = -2 ELSE Port = -1
  3018. IF Port = -2 THEN Modem = Modem + 1
  3019. READ #1, Temp$;1
  3020. IF ASC(Temp$) <> 0 THEN ShowTime = TRUE ELSE ShowTime = FALSE
  3021. READ #1, Temp$;35, Temp$;1
  3022. IF ASC(Temp$) <> 0 THEN ShowChoice = TRUE ELSE ShowChoice = FALSE
  3023. READ #1, Temp$;41
  3024. UserLog$ = FN MakeStr$(Temp$) + ":UserLog"
  3025. READ #1, Temp$;41
  3026. CallerLog$ = FN MakeStr$(Temp$) + ":CallerLog"
  3027. READ #1, Junk$;177, Temp$;1
  3028. MultiFinder = ASC(Temp$) : ' TRUE if non-zero, otherwise FALSE
  3029. CLOSE #1
  3030. SEGMENT RETURN
  3031. '
  3032. "No Info"
  3033. ERROR = 0
  3034. CLS
  3035. PRINT
  3036. PRINT "Archie doesn't recognize anything here. Please enter the Host"
  3037. PRINT "program path and name so that Archie can go to work."
  3038. PRINT
  3039. Archie$(130) = ""
  3040. LINE INPUT "Host name? ";Archie$(130)
  3041. IF Archie$(130) = "" THEN "Desktop"
  3042. PRINT
  3043. PRINT "Now please enter the name of the main Archie Menu."
  3044. PRINT
  3045. Archie$(131) = ""
  3046. LINE INPUT "Archie menu? ";Archie$(131)
  3047. PRINT
  3048. IF Archie$(131) = "" THEN "Desktop"
  3049. Archie$(132) = "10"
  3050. Archie$(133) = "5"
  3051. Archie$(134) = "5"
  3052. Archie$(135) = "200"
  3053. Archie$(136) = "25"
  3054. Archie$(137) = "1"
  3055. Archie$(138) = "1"
  3056. FOR Resource% = 130 TO 138
  3057. SHndl& = FN GETRESOURCE(CVI("STR "), Resource%)
  3058. CALL RMVERESOURCE(SHndl&)
  3059. GOSUB "Resource Error?"
  3060. SHndl& = FN NEWSTRING(Archie$(Resource%))
  3061. CALL ADDRESOURCE(SHndl&, CVI("STR "), Resource%, ResName$(Resource%))
  3062. GOSUB "Resource Error?"
  3063. SHndl& = FN GETNAMEDRESOURCE(CVI("STR "), ResName$(Resource%))
  3064. CALL WRITERESOURCE(SHndl&)
  3065. GOSUB "Resource Error?"
  3066. NEXT Resource%
  3067. ON ERROR RETURN
  3068. GOSUB "Desktop"
  3069. '
  3070. "No Config"
  3071. ERROR = 0
  3072. BEEP
  3073. PRINT
  3074. PRINT "There's a problem with the Config file! It's either missing or it"
  3075. PRINT "is not properly set up."
  3076. PRINT
  3077. PRINT Exit$;
  3078. DO
  3079. UNTIL LEN(INKEY$)
  3080. PRINT
  3081. GOSUB "Desktop"
  3082. '
  3083. '    ------------- Resource Error? -------------
  3084. "Resource Error?"
  3085. Errnum = FN RESERROR
  3086. LONG IF Errnum <> 0
  3087. BEEP
  3088. PRINT "Error #";Errnum
  3089. PRINT "Problem with Archie resource file!"
  3090. PRINT
  3091. PRINT Continue$;
  3092. DO
  3093. UNTIL LEN(INKEY$)
  3094. GOSUB "Desktop"
  3095. END IF
  3096. RETURN
  3097. '
  3098. '    ------------- Alter User Defaults -------------
  3099. SEGMENT
  3100. "Alter Default"
  3101. GOSUB "Echo LF"
  3102. Temp$ = "You can now alter Archie's default values."
  3103. GOSUB "Newline Echo"
  3104. Temp$ = "Archie needs seven answers:"
  3105. GOSUB "Newline Echo"
  3106. Temp$ = "<1> How many downloads are allowed per upload"
  3107. GOSUB "Newline Echo"
  3108. Temp$ = "<2> How many messages are equivalent to one upload"
  3109. GOSUB "Newline Echo"
  3110. Temp$ = "<3> Minimum number of calls to qualify (give new callers a break!)"
  3111. GOSUB "Newline Echo"
  3112. Temp$ = "<4> Privilege level (at or above this clearance level is ignored)"
  3113. GOSUB "Newline Echo"
  3114. Temp$ = "<5> Number of downloads to use in finding downloaders"
  3115. GOSUB "Newline Echo"
  3116. Temp$ = "<6> Number of uploads to exempt downloader from listing"
  3117. GOSUB "Newline Echo"
  3118. Temp$ = "<7> Number of public messages to exempt downloader from listing"
  3119. GOSUB "Newline Echo"
  3120. Temp$ = "For guidance, Archie's initial settings are 10, 5, 5, 200, 25, 1 and 1."
  3121. GOSUB "Newline Echo"
  3122. Temp$ = "The current setting is shown in <brackets>. To keep it, hit Return."
  3123. GOSUB "Newline Echo"
  3124. GOSUB "Echo LF"
  3125. Archie$(130) = Host$
  3126. Archie$(131) = ArchieMenu$
  3127. Temp$ = "Downloads per upload <"+Archie$(132)+">? "
  3128. GOSUB "Reply & Strip Spaces"
  3129. LONG IF Reply$ <> ""
  3130.   Archie$(132) = Reply$
  3131.   DLValue = VAL(Reply$)
  3132. END IF
  3133. Temp$ = "Messages equal to one upload <"+Archie$(133)+">? "
  3134. GOSUB "Reply & Strip Spaces"
  3135. LONG IF Reply$ <> ""
  3136.   Archie$(133) = Reply$
  3137.   MsgValue! = VAL(Reply$)
  3138. END IF
  3139. Temp$ = "Minimum number of calls to qualify <"+Archie$(134)+">? "
  3140. GOSUB "Reply & Strip Spaces"
  3141. LONG IF Reply$ <> ""
  3142.   Archie$(134) = Reply$
  3143.   NewCall = VAL(Reply$)
  3144. END IF
  3145. Temp$ = "Privilege level <"+Archie$(135)+">? "
  3146. GOSUB "Reply & Strip Spaces"
  3147. LONG IF Reply$ <> ""
  3148.   Archie$(135) = Reply$
  3149.   Privilege = VAL(Reply$)
  3150. END IF
  3151. Temp$ = "Number of downloads to list <"+Archie$(136)+">? "
  3152. GOSUB "Reply & Strip Spaces"
  3153. LONG IF Reply$ <> ""
  3154.   Archie$(136) = Reply$
  3155.   CheckDL = VAL(Reply$)
  3156.   CheckDL$ = Reply$
  3157. END IF
  3158. Temp$ = "Number of uploads to exempt <"+Archie$(137)+">? "
  3159. GOSUB "Reply & Strip Spaces"
  3160. LONG IF Reply$ <> ""
  3161.   Archie$(137) = Reply$
  3162.   CheckUL = VAL(Reply$)
  3163.   CheckUL$ = Reply$
  3164. END IF
  3165. Temp$ = "Number of public messages to exempt <"+Archie$(138)+">? "
  3166. GOSUB "Reply & Strip Spaces"
  3167. LONG IF Reply$ <> ""
  3168.   Archie$(138) = Reply$
  3169.   CheckMsg = VAL(Reply$)
  3170.   CheckMsg$ = Reply$
  3171. END IF
  3172. FOR Resource% = 130 TO 138
  3173.   SHndl& = FN GETRESOURCE(CVI("STR "), Resource%)
  3174.   CALL RMVERESOURCE(SHndl&)
  3175.   GOSUB "Resource Error?"
  3176.   SHndl& = FN NEWSTRING(Archie$(Resource%))
  3177.   CALL ADDRESOURCE(SHndl&, CVI("STR "), Resource%, ResName$(Resource%))
  3178.   GOSUB "Resource Error?"
  3179.   SHndl& = FN GETRESOURCE(CVI("STR "), Resource%)
  3180.   CALL WRITERESOURCE(SHndl&)
  3181.   GOSUB "Resource Error?"
  3182. NEXT Resource%
  3183. SEGMENT RETURN
  3184. '
  3185. '    ------------- Reply & Strip Spaces -------------
  3186. '
  3187. "Reply & Strip Spaces"
  3188. GOSUB "Noline Echo"
  3189. GOSUB "Get A Line"
  3190. LONG IF Reply$ <> ""
  3191. Text$ = ""
  3192. FOR Count% = 1 TO LEN(Reply$)
  3193. Temp$ = MID$(Reply$, Count%, 1)
  3194. IF Temp$ <> " " THEN Text$ = Text$ + Temp$
  3195. NEXT Count%
  3196. Reply$ = Text$
  3197. END IF
  3198. RETURN
  3199. '
  3200. '    ------------- Error Report -------------
  3201. "Error Report"
  3202. TheError$ = ERRMSG$(ERROR)
  3203. Error = 0
  3204. ON ERROR GOSUB "Argh!"
  3205. OPEN "A", 2, "Archie Errorlog"
  3206. PRINT #2, "*** Archie encountered an error on ";DATE$;" at ";TIME$
  3207. PRINT #2, "*** The ZBasic error message is ";TheError$
  3208. PRINT #2, "*** The current command is";Command
  3209. PRINT #2, Dash$
  3210. CLOSE #2
  3211. RETURN
  3212. '
  3213. '    ------------- Exit Routines -------------
  3214. "Launch App"
  3215. '    -- Here's an exit
  3216. GOSUB "Kill Pictures"
  3217. GOSUB "Write to CallerLog"
  3218. RUN Option$
  3219. END: ' In case we come back here under MultiFinder
  3220. '
  3221. "No Update"
  3222. GOSUB "Wipe LaunchRRH"
  3223. GOSUB "Hang Up"
  3224. "Exit"
  3225. IF ERROR GOSUB "Error Report"
  3226. ON ERROR GOSUB "Argh!"
  3227. LONG IF Command = 102
  3228. GOSUB "Wipe LaunchRRH"
  3229. GOSUB "Hang Up"
  3230. '    -- Here's an exit
  3231. GOSUB "Kill Pictures"
  3232. SHUTDOWN
  3233. END IF
  3234. "Change Menu"
  3235. LONG IF Command = 99 AND ArchieLocal = FALSE
  3236. Temp$ = HostPath$ + LaunchFile$
  3237. OPEN "R", #1, Temp$, 1
  3238. Temp$ = CHR$(LEN(Option$))
  3239. Temp = LEN(Option$)
  3240. RECORD #1, 27
  3241. IF Temp < 41 THEN WRITE #1,Temp$;1,Option$;Temp
  3242. CLOSE #1
  3243. END IF
  3244. "Back to Host"
  3245. '    -- Here's an exit
  3246. GOSUB "Kill Pictures"
  3247. '
  3248. IF NOT MultiFinder THEN RUN Host$ ELSE END
  3249. '
  3250. "Desktop"
  3251. '    -- Here's an exit
  3252. GOSUB "Kill Pictures"
  3253. END
  3254. "Argh!"
  3255. '    -- Here's an exit
  3256. GOSUB "Kill Pictures"
  3257. SHUTDOWN
  3258. '
  3259. '    ------------- Wipe LaunchRRH -------------
  3260. "Wipe LaunchRRH"
  3261. LONG IF ArchieLocal = FALSE
  3262. Temp$ = HostPath$ + LaunchFile$
  3263. KILL Temp$
  3264. '
  3265. '    Next routine updates CallerLog if it's specified in Config file
  3266. LONG IF CallerLog
  3267. OPEN "A", 1, CallerLog$
  3268. PRINT #1, "Logged off on ";DATE$;" at ";TIME$
  3269. PRINT #1, Dash$
  3270. CLOSE #1
  3271. END IF
  3272. '
  3273. '    Next routine updates printed log if it's specified in Config file
  3274. LONG IF PrintCallerLog
  3275. OPEN "C", PPort, 9600
  3276. HANDSHAKE PPort, -1
  3277. PRINT #PPort, "Logged off on ";DATE$;" at ";TIME$
  3278. PRINT #PPort, Dash$
  3279. CLOSE #PPort
  3280. END IF
  3281. END IF
  3282. RETURN
  3283. '
  3284. '    ------------- Hang Up -------------
  3285. "Hang Up"
  3286. GOSUB "Check Modem"
  3287. LONG IF NOT Local
  3288. GOSUB "Flush Keystrokes"
  3289. DELAY 1250
  3290. PRINT #Port, "+++";
  3291. DELAY 1250
  3292. PRINT #Port, "ATHS0=0"
  3293. DELAY 500
  3294. GOSUB "Flush Keystrokes"
  3295. END IF
  3296. RETURN
  3297. '
  3298. '    ------------- FSection Error -------------
  3299. "FSection Error"
  3300. TheError$ = ERRMSG$(ERROR)
  3301. Error = 0
  3302. ON ERROR GOSUB "Argh!"
  3303. GOSUB "Echo LF"
  3304. Temp$ = "Archie encountered an error while trying to read a file."
  3305. GOSUB "Newline Echo"
  3306. GOSUB "Echo LF"
  3307. Temp$ = "The ZBasic error message is "+TheError$
  3308. GOSUB "Newline Echo"
  3309. Temp$ = "The current command is "+STR$(Command)
  3310. GOSUB "Newline Echo"
  3311. GOSUB "Echo LF"
  3312. Temp$ = "The following file could not be found:"
  3313. GOSUB "Newline Echo"
  3314. Temp$ = Option$
  3315. GOSUB "Newline Echo"
  3316. GOSUB "Echo LF"
  3317. Temp$ = "Please check that you have the proper path and file name."
  3318. GOSUB "Newline Echo"
  3319. GOSUB "Echo LF"
  3320. Temp$ = Continue$
  3321. GOSUB "Noline Echo"
  3322. GOSUB "Get A Key"
  3323. IF Hit$ <> CR$ THEN GOSUB "Echo LF"
  3324. RETURN "FSec Closed"
  3325. '
  3326. '    ------------- Turn Menus On -------------
  3327. "Turn Menus On"
  3328. '    This next section enables menu functions every now and then
  3329. MenuTimer = MenuTimer + 1
  3330. LONG IF MenuTimer = 25
  3331. MenuTimer = 1
  3332. MENU ON
  3333. MENU OFF
  3334. END IF
  3335. RETURN
  3336. '
  3337. '    ------------- Menu Event -------------
  3338. "Menu Event"
  3339. MenuBar = MENU(0)
  3340. MenuItem = MENU(1)
  3341. MENU
  3342. LONG IF MenuBar = 255
  3343. LONG IF MenuItem = 1
  3344. WINDOW 4, "", (14, 57) - (248, 159), 3
  3345. PICTURE(0,0), ArchieLogo&
  3346. DO
  3347. UNTIL MOUSE(3)
  3348. WINDOW CLOSE #4
  3349. END IF
  3350. END IF
  3351. LONG IF MenuBar = 1
  3352. '    -- Here's an exit
  3353. LONG IF MenuItem = 1
  3354. GOSUB "Kill Pictures"
  3355. CLOSE
  3356. IF NOT MultiFinder THEN RUN Host$ ELSE END
  3357. END IF
  3358. LONG IF MenuItem = 2
  3359. Answer$ = FILES$(1, "APPL",, V%)
  3360. IF Answer$ = "" THEN "No Go"
  3361. '    -- Here's an exit
  3362. GOSUB "Kill Pictures"
  3363. CLOSE
  3364. RUN Answer$, V%
  3365. END: ' In case we come back here under MultiFinder
  3366. END IF
  3367. '    -- Here's an exit
  3368. LONG IF (MenuItem = 4) AND NOT ArchieLocal
  3369. GOSUB "Kill Pictures"
  3370. GOSUB "No Update"
  3371. END IF
  3372. '    -- Here's an exit
  3373. LONG IF MenuItem = 5
  3374. GOSUB "Kill Pictures"
  3375. END
  3376. END IF
  3377. END IF
  3378. LONG IF (MenuBar = 3)
  3379. LONG IF (MenuItem = 1)
  3380. ChatFlag = NOT ChatFlag
  3381. LONG IF ChatFlag
  3382. MENU 3, 1, 1, "End Chat"
  3383. XELSE
  3384. MENU 3, 1, 1, "Break in for Chat"
  3385. END IF
  3386. END IF
  3387. END IF
  3388. "No Go"
  3389. MENU
  3390. RETURN
  3391. '
  3392. '    ------------- Kill Pictures -------------
  3393. "Kill Pictures"
  3394. KILL PICTURE Pic1&
  3395. KILL PICTURE Pic2&
  3396. KILL PICTURE ArchieLogo&
  3397. RETURN
  3398. '
  3399. '    ------------- Chat -------------
  3400. '
  3401. "Chat"
  3402. GOSUB "Echo LF"
  3403. GOSUB "Echo LF"
  3404. Temp$ = "Sysop is breaking in to chat..."
  3405. GOSUB "Newline Echo"
  3406. GOSUB "Echo LF"
  3407. WHILE ChatFlag
  3408. GOSUB "Turn Menus On"
  3409. Temp$ = INKEY$
  3410. LONG IF LEN(Temp$)
  3411. GOSUB "Noline Echo"
  3412. XELSE
  3413. LONG IF NOT Local
  3414. READ #Port, Temp$;0
  3415. IF LEN(Temp$) THEN GOSUB "Noline Echo"
  3416. END IF
  3417. END IF
  3418. WEND
  3419. GOSUB "Echo LF"
  3420. TimeFlag = FALSE
  3421. RETURN
  3422. '
  3423. '    ------------- Data -------------
  3424. '
  3425. DATA "Host/Second Sight Name", "Archie Menu", "DL Value", "Msg Value", "NewCaller"
  3426. DATA "Privilege", "Check DL", "Check UL", "Check Msg"
  3427.